I have a htaccess fil开发者_JS百科e:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
I want to add the line below, but it gives me 500 error.
Options -Indexes
Can somebody help?
Check if the directory where your .htaccess lives in has enabled the neccessary AllowOverride (enabled must be: AuthConfig and Options at least) in the httpd.conf.
Make sure it is not within the
<IfModule mod_rewrite.c>
...
</IfModule>
part of your .htaccess
Usually you should have a logging-message in your error-log. I assume, that you will find something like this:
[alert] [client 192.xxx.xxx.xxx] /path/to/web/.htaccess: Options not allowed here
This solution does not always help (depending on the apache-version you are using): In some cases you have to move this section to your httpd.conf to make it work.
It is explained in detail in the apache-docs.
精彩评论