Forum Moderators: phranque

Message Too Old, No Replies

301 Redirect for Renamed URLs

         

guru5571

4:37 am on Mar 25, 2007 (gmt 0)

10+ Year Member



I've had excellent help on mod_rewrite before. Hope someone can help now.

I originally had URLs with PHP style parameters. In this form.

http://www.domain.com/?country=$1&state=$2&city=$3

I am successfully rewriting those in .htaccess this way.

RewriteRule ^widgets/(.+)/(.+)/(.+)/?$ /?country=$1&state=$2&city=$3

So that my displayed URLs look like this.

http://www.domain.com/widgets/country/state/city/

OK, that works fine. The problem is I have old back links from other peoples sites that still use the original PHP parameter style links.

How do I do a 301 so that those old links will redirect and display the new style URL in the browser? I've tried a bunch of things, but only get a 500 error code or else no change at all.

milanmk

7:02 am on Mar 25, 2007 (gmt 0)

10+ Year Member



Maybe Jim's Changing Dynamic URLs to Static URLs
[webmasterworld.com] should help you.

Milan