Question

I am migrating a website to a drupal CMS.

I would like to know how google responds on a redirect from a redirect. I'll try to explain what i'm trying to accomplish:

The old situation: www.old-site.com/page?pid=123

The new situation: www.new-site.com/page/pagetitle

I want to create a 301 redirect in my .htaccess file as i have done for alot of other pages. But in this particular situation the old page id (pid) is not known in the new website.

My plan is to create the following rewrite rules:

RewriteCond %{QUERY_STRING} ^pid=(.*)$
RewriteRule ^page.aspx$ page-redirect/%1? [R=301,L,NC]

Right now i have the correct page id. What i then want to do is create a little script that rewrites the url from page-redirect/123 to page-redirect/newtitle as i do know the title that comes with the id

Then i want to have the following rule handle the new title:

RewriteRule ^page-redirect/(.*)$ page/%1? [R=301,L,NC]

So basicly the bottomline question is: How does this affect the google index? Our client wants to maintain his (good) organic results in google.

Was it helpful?

Solution

Instead of Redirecting from page.aspx to page-redirect, why not Rewrite to page-redirect. That way page-redirect can figure out the final url page-redirect/newtitle and issue a single 301 redirect for it i.e.

RewriteCond %{QUERY_STRING} ^pid=(.*)$
#just do a server side rewrite instead of a redirect
RewriteRule ^page.aspx$ page-redirect/%1? [L,NC]

The redirect logic will exist within your page-redirect code.

If you still choose to do 2 301 redirects, it is not ideal, but Google should transfer the page-rank of the old urls to the new ones.

Note that either way, when you do move content via a 301 (1 or 2), you should expect a temporary dip in your page rank as your old pages drop off the index and the new ones are added.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top