mod_rewrite - redirect from old url to new url

116 views Asked by At

Need your professional help.

I have Joomla 1.5 with VirtueMart

We change SEF, and old url was gone:(

Old url:

http://example.com/126-name-group/147101.html

126-name-group - category name 126 - category id.

147101.html - product

147101 - id product

New url:

http://example.com/katalog/product/126/147101.html

katalog/product - is constant

I'm not professional in mod_rewrite:(

Thx for your help.

1

There are 1 answers

0
anubhava On BEST ANSWER

Use this rule on top of all other rules in your .htaccess

RewriteRule ^([0-9]+)-[^/]+/([0-9]+\.html)$ /katalog/product/$1/$2 [R=301,L]