Sunday, 15 September 2013

mod_rewrite "virtual subdomain" redirect not working

mod_rewrite "virtual subdomain" redirect not working

I've just moved from a Litespeed hosting to an Apache's one. However such
redirects stopped working.
RewriteCond %{HTTP_HOST} ^nix.foo.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.nix.foo.com$
RewriteRule ^(.*)$ "http\:\/\/www\.foo\.com\/nix\.php" [R=301,L]
On Firefox, I get a "failed to connect to the server" message. I tried
simpler mod_rewrite redirects such as
RewriteRule ^foo.php$ bar.php
and they work, so mod_rewrite seems to be already enabled thanks to
RewriteEngine on.
Any hints? Thanks

No comments:

Post a Comment