Welcome Guest | Login

Redirect www.site.com to site.com

How can I redirect visitors from www.mysite.com to mysite.com? I tried through the Redirects portion of the control panel but it didn't seem to work. Every time I thought I was setting it up properly, the confirmation said I was redirecting mysite.com to mysite.com.

2008-01-14 10:16 PM

I hope the following rewrite rule will help you to do so.

RewriteCond %{http_host} ^www.mysite.com [nc]
RewriteRule ^(.*)$ http://mysite.com/$1 [r=301,nc]

2008-01-14 11:18 PM

Regards,
Rahul
Thanks Rahul. I had trouble with it because I made it the last rewrite rule. It worked great once I figured out that it need to be the first rule.

2008-01-15 09:13 PM

This seems to have worked better for me.


In my .htacces
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^askapache\.com$ [NC]
RewriteRule ^(.*)$ http://askapache.com/$1 [R=301,L]

2008-01-19 04:52 PM


Hello Guest! In order to post you must be an active client with us, please log in or sign up today!