Mobile app version of vmapp.org
Login or Join
Eichhorn148

: This question really belongs better to webmasters.se and I can see it moved soon. Still, in one of your comments you asked how to allow only one parameter value in your Apache config, and

@Eichhorn148

This question really belongs better to webmasters.se and I can see it moved soon. Still, in one of your comments you asked how to allow only one parameter value in your Apache config, and thought to give you an example:

RewriteEngine On
RewriteCond %{REQUEST_URI} (?|&)productid= [NC]
RewriteCond %{REQUEST_URI} !(?|&)productid=1(?|$) [NC]
RewriteRule ^(.*)$ - [F]


This rule will only apply in cases where a request URL parameter productid exists, but isn't exactly 1 (URL ends with it or the next parameter begins). It will issue a Forbidden response if both conditions (and only both of them, notice the lack of [OR] between conditions to concatenate them) are true. There are other ways of achieving same thing, but this one popped out my head now, before this thread is moved to where it belongs. Cheers! ;)

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Eichhorn148

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme