jeudi 26 mars 2015

htaccess Detect Query then add Anchor tag - Sooo close

This SOMETIMES works - but under certain conditions I end up with the dreaded redirect loop. Scenario:


Use htaccess to look for a specific Query string, and if found, simply add a '#filter' to the end of the url and send it on its way.



RewriteCond %{QUERY_STRING} ^(.*)wpv_filter_submit=Apply(.*)$
RewriteRule ^(.*)$ /$1?%1&wpv_filter_submit=Apply&%2#filter [L,R=301,NE]


In some cases it actually works, others not. I think the problem is that there could be any number of query strings before or after this one and I'm not accounting for that properly?


It seems simple - just detect and add - but so far not the case.


Any thoughts greatly appreciated


Aucun commentaire:

Enregistrer un commentaire