S
S
Sergey Beloventsev2016-07-27 23:49:19
ubuntu
Sergey Beloventsev, 2016-07-27 23:49:19

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>

this also gave sudo a2enmod rewrite
such a thing AccessFileName .htaccessin apache.conf,
but I still type film.lc and the list of files and folders of the site falls out, but not like the site itself,
here is the htaccess itself if that
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

2 answer(s)
A
Ankhena, 2016-07-28
@Ankhena

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.

Y
Yuri Chudnovsky, 2016-07-28
@Frankenstine

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 question

Ask a Question

731 491 924 answers to any question