• Resolved hurry

    (@extremist87)


    Hi,

    I was wondering if someone can help me with a bit of a complex redirection, a breeze for the wizards.

    I have a website with 5000 products, we changed the url from /products/ to /examplenew/ using the following redirect;

    /product/(.*)$
    /examplenew/$1

    Now, I was checking the 404 log and found many hits to pages like below from bots; /examplenew/productname/PRODUCTDESCRIPTION

    So I want to build a redirection rule so that it drops trailing PRODUCTDESCRIPTION from every product without making a redirection for each product. Not sure if something like the below will work?

    /product/(.*)1$/^
    /examplenew/$1/

Viewing 1 replies (of 1 total)
  • Plugin Author John Godley

    (@johnny5)

    /product/(.*)1$/^ does not match /examplenew/productname/PRODUCTDESCRIPTION. You would need something like /examplenew/productname/(.*)

    https://regex101.com/ can help you create regular expressions

    • This reply was modified 3 years, 9 months ago by John Godley.
Viewing 1 replies (of 1 total)
  • The topic ‘Help with complex redirection’ is closed to new replies.