开发者

mod_rewrite enabled, but .htaccess does not work

开发者 https://www.devze.com 2023-02-22 01:28 出处:网络
I\'m having a problem with my .htaccess. on the phpinfo() page, I see that \'mod_rewrite\' is in the \'loaded mo开发者_运维技巧dules\' under \'apache2handler\', but my .htaccess does not work..

I'm having a problem with my .htaccess.

on the phpinfo() page, I see that 'mod_rewrite' is in the 'loaded mo开发者_运维技巧dules' under 'apache2handler', but my .htaccess does not work..

.htaccess 

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php

Do I have an error with .htaccess?


If you have an error with .htaccess Apache will generally give you a 500 response. To be honest, a "cheap" way that I use to make sure I have my configuration correct is to put garbage like "alksdjfalsdkjf" in .htaccess - error 500 means I enabled it, no error means I forgot something. ;)

You might want to check your AllowOverride settings.


Try adding

Options +FollowSymLinks

Above rewrite engine on and see if that works

0

精彩评论

暂无评论...
验证码 换一张
取 消