views:

19

answers:

2

Hi

I'm trying to redirect an old url to a new one using 301

I need an example of RewriteQueryString for the following 301? http://www .example.com/search/?depId=1&typeCatId=1 to the following http://www.example.com/mens/clothing

So when I type in the long URL in the browser, I am redirected to the new, shorter URL

Any ideas?

A: 

You could use mod_rewrite either in your .htaccess file or the apache configuration. You might take a look at the RewriteMap feature if you are going to have a lot of different departments, etc. to map. Using the [R] flag after the RewriteRule will cause the browser to redirect instead of just being an internal redirect. Using [R=301] will make it a 301 redirect.

Andrew
A: 
RewriteEngine On
RewriteRule ^search/\?depId=1&typeCatId=1$ /mens/clothing [R=301]

^ Try that.

chigley