[Wylug-help] Apache .htaccess file.
Douglas G Mckendrick
douglasg.mckendrick at googlemail.com
Fri Oct 16 19:36:26 UTC 2009
Hi all, I'm wanting to stop http://example.com from showing up on my web
page, and have all links point to http://www.example.com
So I downloaded below code from google, edited it with my domain, then
just copy and pasted it into .htaccess file. But it doesn't seem to be
working, any advice? Cheers
Doug
# For sites running on a port other than 80
RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{SERVER_PORT} !^80$
RewriteRule ^/(.*) http://www.example.com:%{SERVER_PORT}/$1 [L,R]
# And for a site running on port 80
RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^/(.*) http://www.example.com/$1 [L,R]
More information about the Wylug-help
mailing list