Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

.htaccess, can I block all requests starting with exactly "/index.php?action="

Is there a .htacces way to block all request starting with exactly /index.php?action=?

I figured out:

RewriteCond %{QUERY_STRING} \baction=\b [NC]
RewriteRule ^ - [F]

But how do I put the part /index.php? in front of that pattern. I tried a lot, but it didn’t work and only this part of the pattern also blocks &action= parameters somewhere else in a URL

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Hope you can help. Many thanks in advance,
Nico

>Solution :

You can use THE_REQUEST variable to match full URL and block it like this:

RewriteCond %{THE_REQUEST} /index\.php\?action= [NC]
RewriteRule ^ - [F]
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading