Welcome to WebmasterWorld Guest from 54.196.233.239

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

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

     

basketmen

12:28 am on Oct 26, 2011 (gmt 0)

5+ Year Member



Hi guys,

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

RewriteEngine On
RewriteCond %{HTTP_HOST} ^[url]www.yourdomain.com[/url] [NC]
RewriteRule ^(.*)$ [yourdomain.com...] [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} ^[url]www.yourdomain.com[/url] [NC]
RewriteRule ^(.*)$ [yourdomain.com...] [L,R=301]
RewriteCond %{HTTP_HOST} ^[url]www.yourdomain2.com[/url] [NC]
RewriteRule ^(.*)$ [yourdomain2.com...] [L,R=301]






please share your knowledge, what is the best way for this?

g1smd

12:34 am on Oct 26, 2011 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



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

Use example.com in this forum to prevent URL auto-linking.

You have missing escaping in your patterns. If there's a port number appended to any non-www request, your code fails to redirect it.

There are at least four threads in the last three days with domain canonicalisation code and long discussions as to how it works.

lucy24

3:20 am on Oct 26, 2011 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



Where is it supposed to be redirecting from, and where is it supposed to be redirecting to?

I don't mean domain names. I mean actual, physical locations. The request has to arrive at the htaccess containing your Rule, and then it has to go to its destination. If either of those locations is not set up to accept requests, or if there is no DNS to tell it where to go in the first place, there will be a problem. Here it sounds as if the problem is at the receiving end. Are you redirecting requests to a parked domain?
 

Featured Threads

Hot Threads This Week

Hot Threads This Month