Home What 301 redirect would work for this string format?
Reply: 0

What 301 redirect would work for this string format?

user1047
1#
user1047 Published in June 18, 2018, 7:38 am

I have an ecommerce store with the product URL format: /categoryname/subcat1name/subcat2name/1450--my-widget

I will shorten it to: /1450--my-widget

I can do the change within the ecommerce software, but I need to set up a mod rewrite redirect for the old URLs.

To avoid matching URLs for categories, content pages, etc, as well as product URLs of the new format, I need to match on all these conditions:

  1. Does not contain the string "/info/"
  2. Contains a slash, followed by 1 or more characters, followed by another slash, followed by 1 or more digits, followed by "--", followed by 1 or more characters

What directive would work?

EDIT: More examples of matching and non matching strings

Matches for old product url:

/a-category/this-category/333--my-widget
/some-cat/34--widgetname

Non matches:

/1918--widgetcategory/
/info/12--about-us
/quick-order
/login?back=my-account
/2050--my-widgetname
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.414875 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO