Forum Moderators: phranque

Message Too Old, No Replies

Need help with 301 redirecting

redirecting to different link structure

         

kheruc

6:01 pm on Aug 1, 2007 (gmt 0)

10+ Year Member



Hello

I have bought a new domain for my site and I need help with redirecting old domain to new.

Link structure will be completely differend:

www.oldsite.com/section/category/article1.html
www.newsite.com/something-else/something-else1.html

My plan is to create 301 redirection in .htaccess for every of my 50 content links separately, and to redirect other non content links just to www.newsite.com.
How?

jdMorgan

11:23 pm on Aug 1, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



See Apache mod_alias [httpd.apache.org] or mod_rewrite [httpd.apache.org].

Be aware that changing the domain *and* the page URLs all at the same time means that it is very likely your site will drop in the search results for anywhere from 30 days to a year. Search engines don't like it all when you change URLs or change domain names. This project does both.

Jim

kheruc

10:13 am on Aug 2, 2007 (gmt 0)

10+ Year Member



I know that I will lose my rankings, but I only have 50 content pages with pagerank 2-4.
I also have 50 new content pages that will be published on new site.
I think that my new link structure will help me later with rankings.

I need more help with redirecting.
I will redirect all my 50 content pages like this:

Redirect 301 /section/cat/article.html http://www.example.com/something-else/blabla.html

I think this will be ok.

But I don't know how to redirect all other non content pages only to http://www.example.com

If I have:
Redirect 301 / http://www.example.com/

It redirects /non-content-page/ to http://www.example.com/non-content-page/ instead to http://www.example.com/

[edited by: jdMorgan at 4:50 pm (utc) on Aug. 2, 2007]
[edit reason] example.com [/edit]

jdMorgan

4:39 pm on Aug 2, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Use RedirectMatch:

RedirectMatch 301 ^/(.*)$ http://www.example.com/

Jim

[edited by: jdMorgan at 4:42 pm (utc) on Aug. 2, 2007]

kheruc

7:23 pm on Aug 2, 2007 (gmt 0)

10+ Year Member



Thanks Jim, this works

kheruc

11:57 am on Aug 3, 2007 (gmt 0)

10+ Year Member



One more question about ratings.

For pages that will no longer exist on new domain, is it better to redirect them to homepage of new domain, or not to redirect at all and leave them to return 404?

jdMorgan

12:50 pm on Aug 3, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Actually, I'd advise configuring a 410-Gone response, using either mod_alias or mod_rewrite, for all URLs which have intentionally been removed.

404-Not found means the file can't be found, but gives not more information. So the search engine doesn't know if it's a bad link on your site or another site, or whether you accidentally removed the file, or whether your script (if you use one) is bad, or whether your server is mis-configured... So what should it do? There's no good answer, so most search engines keep trying to re-fetch the URL, either for hours or for months...

410-Gone says, "This page is gone because it was intentionally removed. Nothing more to see here, folks, move along..."

Jim