lundi 19 octobre 2015

Regex match all expect parameters

I have a particular problem with regex redirect.

Summary:

I have the following structure: http://ift.tt/1XfXa6I

We also have filters at the product level. For example

http://ift.tt/1OERLof

Problem: A lot of the (product-name) the last part of the url gets deleted often, so Google webmaster tools shows those pages as 404.

We redirect the user of the 404 page to the main products directory. For example:

/director/products/product-name (now 404) the user will be redirected to /director/products/. The single product page is meaningless so that's why we don't need the user to go to the single product page, instead the user can find everything on the main products page.

We use the following regex with our plugin to do the redirect

/director/products/(.+)

Now we are running into the problem that the filters also redirect to /director/products/

So /director/products/?filtername=top also redirects to /director/products/

I have tried a number of examples however I can't get the parameters to be excluded from the redirect. Can any expert help me out here?

Thank you



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire