Forum Moderators: open

Message Too Old, No Replies

redirect www.abcd.com to abcd.com

         

peony

12:54 pm on Jun 18, 2005 (gmt 0)

10+ Year Member



i want to redirect www.abcd.com to abcd.com.
but i am a newbie of html.
so can someone show me how to do that step by step?

larryhatch

1:02 pm on Jun 18, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello Peony: I cannot help with step-by-step methods, but I do have one caution!
IF you redirect from abcd.com to abcd.com using some rewrite rule in your .htaccess file,
you could cause an endless loop and get booted out of your host ISP!

What I think you really want, is to redirect from abcd.com to bcde.com. (note different URLS.)

That is at least do-able.
Right now, I'm more concerned with sites that redirect to mine in nasty ways. -Larry

Span

4:56 pm on Jun 18, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Peony,

Step 1:
Find out if your site is on an Apache server. If so,

Step 2:
Find out if you are allowed to use an .htaccess. If yes,

Step 3:
Is the Rewrite module enabled? If positive,

Step 4:
With a text editor, create a file and save it as htaccess.txt

Step 5:
Paste this code in there and change 'example.com' in your domain name on both lines:


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

Step 6:
Upload the file to the root of your domain (where your index file is) and rename it to .htaccess

Step 7:
Empty your browser cache and go to your domain with www in front of it and see what happens.

Step 8:
Let us know..

g1smd

10:55 am on Jun 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Did it work?

It should have, if your site uses Apache...

rocknbil

3:22 pm on Jun 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You shouldn't have to do any of that. If you call up abcd.com and www.abcd.com and one is broken, contact your ISP, something is wonky with their DNS. Either of those should point to the same domain.

g1smd

3:29 pm on Jun 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Yes, they should both point to the same domain, but search engines will see that domain.com/somepage.html and www.domain.com/somepage.html are duplicates. They will randomly drop one or the other from their index. Some pages will end up being attached to domain.com and others will end up being attached to www.domain.com instead. This messes up the pagerank for the pages, and the indexing of the site. Many of the pages will drop back to URL-only listings.

Adding the 301 redirect completely fixes the problem. Only one version of the pages will be indexed, and it will be the same version for every page of the site.