Welcome to WebmasterWorld Guest from 50.16.112.199

Forum Moderators: Ocean10000 & incrediBILL & phranque

Newbie question about name servers

canonical issues

   
3:13 pm on Nov 10, 2012 (gmt 0)

5+ Year Member



Hi
I have a question regarding name servers. I'm not sure how to ask it so I'll use an example.

Ns2.mydomain.com resloves to mydomain.com
Does this not cause canonical issues? And if it does how do I reslove it?

Is there a way in htaccess to redirect all occurances of ns2.mydomain.com to mydomain.com
3:35 pm on Nov 10, 2012 (gmt 0)

5+ Year Member



Sorry what I should have asked is how do I make it so ns2.mydomain.com when typed into the browser shows a 404? Or does it matter?
4:35 pm on Nov 10, 2012 (gmt 0)



Here's something I use in htaccess:
RewriteCond %{HTTP_HOST} ^example.com [OR]
RewriteCond %{HTTP_HOST} ns1.example.com [OR]
RewriteCond %{HTTP_HOST} ns2.example.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

It's the same as rewriting your non-www to www, note the "R=301", it tells search engines like Google this is permanent.

EDIT: Chnged domain to example.com

[edited by: Str82u at 5:13 pm (utc) on Nov 10, 2012]

4:50 pm on Nov 10, 2012 (gmt 0)

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



Please use example.com in this forum, as per the sticky note at the top of the forum thread list.

Your example fails to redirect some non-canonical requests.

Escape all literal periods in patterns.

RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month