Redirect WWW to non WWW, for primary domain, and parked domain

1 replies
Hi guys,

I already know basic Redirect www to non-www, using htaccess:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.yourdomain.com [NC]
RewriteRule ^(.*)$ http://yourdomain.com/$1 [L,R=301]





but how if we have parked domain too?

I already tried this but its not works, its says "The page isn't redirecting properly"

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.yourdomain.com [NC]
RewriteRule ^(.*)$ http://yourdomain.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^yourdomain2.com - Domain name registration Resources and Information. This website is for sale! [NC]
RewriteRule ^(.*)$ http://yourdomain2.com/$1 [L,R=301]




please share your knowledge, what is the best way for this?
#domain #parked #primary #redirect #www
  • Profile picture of the author dv8domainsDotCom
    yeah, depends who parked with and how 'they' instruct you to configure your domain. If it involves changing a nameserver, then probably not, although there are ways you can accomplish this by managing dns yourself (set primary A-record to 'point' to IP of park server, WWW to YOUR host IP, where your .htaccess resides to redirect back to non-www). more advanced but it'll work (UNLESS park service ALSO has htaccess to redirect to WWW again lol). In which case, the short answer is 'no' hehe
    Signature
    Support a Warrior, Save Money!
    Rock Bottom Prices on Domains and Website Hosting
    {{ DiscussionBoard.errors[4936328].message }}

Trending Topics