Answer the question
In order to leave comments, you need to log in
Why is htaccess not enabled?
as always here is film.lc.conf
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName film.lc
ServerAlias www.film.lc
DocumentRoot /var/www/film.lc/
<Directory «/var/www/film.lc»>
AllowOverride All
Order allow,deny
Allow from all
Options +Indexes
</Directory>
ErrorLog /var/www/error.log
CustomLog /var/www/access.log combined
</VirtualHost>
sudo a2enmod rewrite
AccessFileName .htaccess
in apache.conf, cmOptions +FollowSymLinks
IndexIgnore */*
RewriteEngine on
# if request begins with /admin remove admin and ad /backend/web/
RewriteCond %{REQUEST_URI} ^/admin
RewriteRule ^admin/?(.*) /backend/web/$1
# other requests add /frontend/web/$1
RewriteCond %{REQUEST_URI} !^/(frontend/web|backend/web|admin)
RewriteRule (.*) /frontend/web/$1
# if frontend request
RewriteCond %{REQUEST_URI} ^/frontend/web
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /frontend/web/index.php
# if backend request
RewriteCond %{REQUEST_URI} ^/backend/web
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /backend/web/index.php
php_value max_execution_time 3000
Answer the question
In order to leave comments, you need to log in
in .htaccess specify DirectoryIndex index.html myindex.html index.pl myindex.php (whatever you need)
If none of the specified files is found, a list of files and directories will be displayed. To prevent this list from being displayed, add an entry to the .htaccess file:
Options –Indexes
In the httpd.conf file, this directive has the form Options Indexes by default, that is, displaying a list of files is allowed.
Everything that you have in .htaccess should be transferred to the config, where is the place for such directives. Rereading the file each time visitors visit the site will not improve the performance of the site. Well, as already mentioned, specify DirectoryIndex, and if you do not want visitors to read the list of files, it does not have an index - change it to "Options -Indexes".
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question