cancel
Showing results for 
Search instead for 
Did you mean: 

Redirect old link style to new. Regex htaccess rewrite

Redirect old link style to new. Regex htaccess rewrite

Need to rewrite links like /2809065.html to /catalogsearch/result/?q=2809065

 

I have a bunch of old blog posts that reference my products by SKU like above. Any regex gurus here?

Can't figure out why the following does not work:

 

RewriteRule ^(\d{7})$ http://www.globalamericaninc.com/catalogsearch/result/?q=$1 [r=301,nc]

 

 Didn't use the CODE tag because it seems to display grey on dark grey.  weird.

 Appreciate any assist on this.