I'm posting here 'cause the old thread is closed..
What is 'ultimate' solution for redirecting all non-www requests to www?
I'm trying with:
VirtualHost {
Hostname = atmarama.net
WebSiteRoot = /some/path/net
UseToolkit = redirect_net, wordpress
StartFile = index.php
AccessLogFile = /some/path/log/net-access.log
ErrorLogFile = /some/path/log/net-error.log
TimeForCGI = 5
UseFastCGI = PHP5
}
VirtualHost {
HostName = www.atmarama.net
WebSiteRoot = /some/path/net
UseToolkit = wordpress
StartFile = index.php
AccessLogFile = /some/path/log/net-access.log
ErrorLogFile = /some/path/log/net-error.log
TimeForCGI = 5
UseFastCGI = PHP5
}
UrlToolkit {
ToolkitID = redirect_net
Match ^/(.*) Redirect http://www.atmarama.net/$1
}
UrlToolkit {
ToolkitID = wordpress
RequestURI exists Return
Match .* Rewrite /index.php
}
Otoh, FAQ entry recommends:
VirtualHost {
Hostname = www.website.net, *.website.net
...
}
but I wonder, due to SEO reasons, whether the above produces correct permanent 301 redirect?
Sincerely,
Gour
p.s. Maybe this topic deserves FAQ entry.