mod_alias Rewrite not working?
I have two servers:
Fedora running Apache/2.2.14 (old server)
CentOs running Apache/2.2.3 (new server)
I've been using this Rewrite rule for quite sometime with absolute success on th开发者_StackOverflow社区e old server:
Redirect 301 /index.html /
But on the new server, it fails miserably with this message [alert] [client 192.168.0.5] /home/yoursite/www/.htaccess: Redirect to non-URL
Checking on the docs... I've found that the old-server should not have accepted the rule as is and the new server should have accepted it. Their are both running an exactly equal httpd.conf
file.
I understand how I can fix this (just redirect to a page with a http://...) I just don't understand why it works on the old server with a previous version of apache (where it should not have worked on the first place) and does not work on the new server (where it should, actually, work).
Has anyone experienced similar?
This was a bug that was fixed in 2.2.6.
Your old server was running a newer version (2.2.14) of Apache where it will accept /
as the target URL; your new server has an old version where mod_alias requires a fully-qualified target URL in Redirect
directives.
Upgrade Apache or specify fully-qualified absolute URLs.
精彩评论