I have a site where there are a load of old URLs like
/section/product/p-69-325/
and I want to change them all to
/section/product/
Can I do that with the Regex option?
Actually, the last part is always in the same format "p-" then a number, a "-" and finally a number - so can I detect that, remove it and redirect to the resulting link?
I want to drop the last section and redirect to the first 2 sections (e.g. /cats/ginger/). I suspect this tool won't allow me to do that - maybe I need to do it in IIS?
Help with Regex needed
I have a site where there are a load of old URLs like
and I want to change them all to
Can I do that with the Regex option?
Actually, the last part is always in the same format "p-" then a number, a "-" and finally a number - so can I detect that, remove it and redirect to the resulting link?
Perhaps this would work:
Then you just use "/section/product/" as your destination URL.
Here is how that regex works:
Sorry, I think my message probably wasn't very clear!
The "section" and "product" parts are variable, not those actual words. So it might be:
exc.
I want to drop the last section and redirect to the first 2 sections (e.g. /cats/ginger/). I suspect this tool won't allow me to do that - maybe I need to do it in IIS?
Not sure about 301 URL Tracker in particular, but in general that is possible using named capture groups. So, the regex would look like this:
And the replacement would look like this:
This new regex also makes use of what is called a "negative lookahead". That ensures the "SECTION" and "PRODUCT" groups don't contain a forward slash.
Give it a try and let us know how it goes.
Did you ever get this working, Gordon?
Sorry for the delay ... been on holiday!
I ended up doing it in IIS with Url Rewrite.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.