[thelist] 301 redirection mess -- two wholesale site-URL-structure changes within 8 months

Phil Turmel philip at turmel.org
Mon Apr 4 19:04:39 CDT 2011


Hi John,

On 04/04/2011 11:35 AM, Gersten, John wrote:
> In September 2010, we replaced our static html site with a dynamic php-based site. The site URLs changed from things like "../page-name.htm" to "../cases.php?CaseID=123" and we facilitated this conversion by stuffing our .htaccess file with several hundred 301 redirects. All well and good, and the conversion went smoothly.
> 
> Cut forward 8 months, and now we are switching to a new dynamic URL approach -- instead of the less-than-optimal string of text and numbers, we've moving to a system where "../cases.php?CaseID=123" becomes "../case/123/page-name".

Good plan, IMHO.

> Any ideas on how to handle the .htaccess 301 redirects for the new update? My big concern relates to leaving the "old" 301 redirects in place. Google and related discussion indicates that such 301 redirects should be left in place permanently, but wouldn't leaving them in mean that the browser gets bounced around inside .htaccess twice before getting served their URL? That seems somehow wrong to me.
> 
> Example: visitor seeks "../page-name.htm" from a pre-September URL. They hit our server, which first redirects the request to "../cases.php?CaseID=123", but then since that page no longer exists, the .htaccess file then takes the request for "../cases.php?CaseID=123" and 301-redirects it to "../case/123/page-name" -- or have I got the wrong end of the stick here?
> 
> We need to accommodate redirection from the old, pre-September URLs as well as the more recent redirections from the numerical system to the "English-language-URLs" approach.
> 
> I realize this is confusing, and I apologize if my explanation only makes things more so. Essentially, I want to be able to have the server properly process URL requests for both the set of pre-September URLs as well as the more recent set of September-April URLs, but can't figure out the best/logical way to do so.

The permanence referred to is not the redirect itself, but the original URL.  The oldest URLs can certainly be redirected in one step to the new URLs.  The goal is for any URL ever published on your site to be reachable at its new address, whatever that might be.  How you accomplish that in your server is an implementation detail.

> Thanks in advance; any ideas/info will be greatly appreciated.
> 
> John

HTH,

Phil


More information about the thelist mailing list