Forum Moderators: phranque
I have been tasked with SEO and have determined that we need to "mask" the urls to hide their complexity. The problem is that because of the number of pages which have been indexed already I have to support the old url format so that users with bookmarks and links from SERPs don't hit dead links.
My questions are as follows:
-Will my site be penalized for duplicate content when I have 2 urls which point to the same page? (Only one of the urls will be used on our site, but the original url is already in the SE indexes and will likely be used to determine duplicate content).
-Is there a way that the SE indexes could be cleared and our site reindexed? (I thought of submitting a remove request followed by a resubmission, but that would take months).
-Should I support the old url format or throw it out?
-If I throw out the old url format how can I keep from loosing traffic?
Here's the old url format:
www.mydomain.com/directory/page.aspx/templatename?State=CA&SSID={GUID}&AreaID={GUID}&SchoolID={GUID}
Here's the new format:
www.mydomain.com/directory/templatename.mxp/California/Boys_Varsity_Football_Fall_04-05/AreaID-{GUID}/SchoolID-{GUID}
NOTE: The new format still has GUIDs but I'm working bit by bit to transform the whole url keeping performance in mind where I have to do lookups to translate the text in the url to key values.
Welcome to WebmasterWorld!
The usual approach is to *internally rewrite* static URLs to their dynamic equivalent, in order to work with your existing script(s). Then *externally redirect* any direct client requests for dynamic URLs to the static URL.
Even a cursory examination of the simple description above will result in the question, "But won't this cause an 'infinite' redirection loop?", and the answer is, "Yes, it could." A bit of care and trickery will solve the problem, though. As a simple example showing what's needed, let's just take a simple one-parameter dynamic URL:
Friendly static URL: www.example.com/buy/car
Unfriendly dynamic URL: www.example.com/buy.php?what=car
# Internally rewrite static URLs to script
RewriteRule ^buy/(.+) /buy.php?what=$1 [L]
#
# Externally redirect client-requested dynamic URLs to new static URLs
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /buy\.php\?what=([^ ]+)\ HTTP/
RewriteRule ^buy\.php$ http://www.example.com/buy/%1 [R=301,L]
Jim
Thanks, I apprecate the reply. From your response it looks like I am on the right track. Your sample includes the code [R=301,L] which indicates a 301 redirect once a dynamic request has been rewritten (see your snippet below).
# Externally redirect client-requested dynamic URLs to new static URLs
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /buy\.php\?what=([^ ]+)\ HTTP/
RewriteRule ^buy\.php$ http://www.example.com/buy/%1 [R=301,L]
I forgot to mention that I am using IIS and while there are equivilents to mod_rewrite out there I chose to write my own (albeit simplified) version to allow me to replace complex query values with simple ones by doing lookups (the site was designed to use GUIDs). But again, you have confirmed my findings for me. Thank you.
Mark