Redirections I was not used to... Are they OK?
| 10:57 pm on Nov 17, 2010 (gmt 0)|
I'm trying to help someone validate the redirects on his websites. I've put in place some easy 301 redirects in the past using .htaceess, but I am far from being an expert.
Here is the situation: The new homemade CMS manages a few websites, and since the new structure is not the same, redirects are required. As an example, the following url is redirected to the following url
These redirects work well from an user point of view, the page are redirected correctly.
What is in the .htacess in regard to the redirect is the following:
RewriteRule ^([^-]+)-([\d]+)-([^\.]+).html?$ redirect.php?articleId=$2 [QSA,L]
To me, it looks like a redirect in the .htaccess file sends the user to a redirect.php file, which in turn redirects the user to the appropriate page. Does this look to you that it is what is happening?
And please correct me if I am wrong, but it does look to me that it is a major issue regarding SEO, since "linkjuice" is not passed to the new urls, right?
Thanks a lot for your help.
| 8:56 pm on Nov 18, 2010 (gmt 0)|
So to be clear, there are "RewriteRules", sometimes known as rewrites, and redirection, sometimes known as redirects.
Rewrites can use regular expressions to match URLs, and when matched either a) map a URL to an internal file, or b) perform a redirect by using the R flag.
The rewrite you provide for example is an internal rewrite. But yours is a tricky case, as we're not sure what happens when redirect.php is executed.
Your rewrite seems to be looking for URLs that match the pattern /category/YYYY-MM-DD/abc/1 (although I think the regular expression is not correct) and then performing an internal rewrite to the file redirect.php, passing along the second captured group from the pattern as a value for the articleId parameter. What redirect.php does is not clear other than what one might guess from the name.
There's no reason that a PHP program couldn't do any kind of redirect or other response. You would have to know what the program does.
There is nothing you have written that could tell anything about whether SEO link juice is being retained -- the rule there is simply: if an old URL now has a new format to a similar or the same webpage, return the HTTP 301 response when the old URL is received with the location of the new URL.