mercredi 29 avril 2015

htaccess - how to redirect url with params to base url

I am trying to redirect a page.html with params at the end to the base url without params. I know I am supposed to use mod rewrite but I can't get the rules figured out. Your help will be appreciated.

Here is the scenario: I tried this in htaccess and this rule didn't work redirect 301 "/page.html?p=2"

I understand from reading other posts on stackoverflow that I should write something like ^page.html$ [QSA,NC,R=301,L]

The rules at the end [QSA,NC,R=301,L] however are incorrect. I can't figure it out. I simply want to do a 301 for this url with the p=2 parameter, and no other param.

And then process the remaining rules after this rule for other pages.

Aucun commentaire:

Enregistrer un commentaire