On 13.08.07 12:58, Nathan wrote:
We need to 301 redirect all traffic bound for www.foo.com to foo.com.
foo.com is set up as an IP based resource and www.foo.com is not
mentioned in vhosts.
both www.foo.com and foo.com DNS is set to the same ip.
We added a section to vhosts like :
We need to 301 redirect all traffic bound for www.foo.com to foo.com.
foo.com is set up as an IP based resource and www.foo.com is not
mentioned in vhosts.
both www.foo.com and foo.com DNS is set to the same ip.
We added a section to vhosts like :
VirtualHost *:80
DocumentRoot
For my sites, I use rewrite:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC]
RewriteRule ^(.*)$ http://domain.com$1 [R=301,L]
Also, if foo.com is used as a IP based virtual host, you could replace *:80
with w.x.y.z:80 so that your server can also host additional IP based
Nathan,
RedirectPermanent is only going to match for the exact URL. If you want it
to match for anything that is LIKE / you will need to use RewriteCond +
RewriteRule OR RedirectMatch. RedirectMatch will map redirect a regular
expression match to a new URL.
RedirectPermanent /