Forum Moderators: phranque

Message Too Old, No Replies

htaccess 301 redirect domain.com to www.domain.com

         

MisterT

3:06 pm on Sep 7, 2006 (gmt 0)

10+ Year Member



I have used this on a new site before, but I'm wondering if it could be harmful to add this to an established website? Would there be some short-term negative SEO affects, and would there be any long-term SEO gain?

jdMorgan

5:22 pm on Sep 7, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Short-term you may indeed see a drop, but a gain over the long-term.

If you want to minimize the drop, start with a specific redirect of only a few pages, then add a few more every month as the previous ones take effect. You may end up with quite a lot of redirect directives, but if you plan carefully, you can start with a specific rule, and make it more general over time.

In other words, write a few redirects for pages in a directory. Then add more pages in that directory. After all have taken effect, replace the per-page redirect with a per-directory redirect. Repeat as needed, until eventually, all pages of all directories are redirected if requested using the non-canonical domain name.

The idea is to minimize the temporary loss of site-internal PR and link-pop as the URLs get updated.

The above is a very general answer. How you would do it depends on your site's URL organization and the 'risk' you're exposed to if you redirect the entire site and it drops in search rankings for 90 days.

For casual readers, the take-home lesson is to install a canonical domain name redirect before taking any site live for the first time.

Jim

MisterT

7:24 pm on Sep 7, 2006 (gmt 0)

10+ Year Member



makes sense, thanks for your response

MisterT

5:11 am on Sep 15, 2006 (gmt 0)

10+ Year Member



ok, similar topic...

if i launched a new site with a home page of /index.html

what should i do to www.domain.com and www.domain.com/index.html

should the www.domain.com 301 to the /index.html?

jdMorgan

5:21 am on Sep 15, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No. Best practice is to never link to /index.anything. Link only and always to "/" for the "home page" URL.

Do you visit google.com/index.php, or google.com/? How about webmasterworld.com/index.htm? -- Is that what you type to get here? I doubt it...

Consider also what will happen if at some time in the future you adopt PHP or Cold Fusion, or some other technology. If you have linked to index.html as your home page, and you change it to index.php, all of your backlinks, bookmarks, and search engine listings will instantly become invalid, and your site will have to all start over again at being indexed by search engines. This actually applies to all pages for which you change the file extension, not just the index page. But certainly, the loss of your index page links will put you out of business for awhile...

Jim

MisterT

6:28 pm on Sep 15, 2006 (gmt 0)

10+ Year Member



ok, thanks for the advice. the example i gave was for .html, but i do understand the same rules would apply for php or anything else.