Log in

View Full Version : Need to remove www from forum URL


MikesSite
09-30-2009, 10:19 PM
A lot of the time when you find my forum via a search engine, it will load the page with www in the URL, which we all know causes problems. Anyway to force www out of the url? Messed around w/ the .htaccess file but couldnt really get it to work. The forum is in the /forums directory, not the root directory and I would only want the forum directory to force out the www.

Thanks.

azn_romeo_4u
09-30-2009, 10:56 PM
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]

Use it in .htaccess in your root dir...I don't think it has to be in the forum dir but if it doesn't work in the root dir, then try the forum dir

MikesSite
09-30-2009, 11:07 PM
Edit: I got it doing what I need it to do now. Thanks.

Quantnet
09-30-2009, 11:16 PM
what problem with www in the forum url?
I don't have any problem and even want to use htaccess to redirect non-www to www as it will prevent duplicated content in google.