There is a file in the root of the site (let's call file.php)
It is necessary through htaccess to chop off access to it, if the address (link) is missing a certain GET parameter.
For example:

  • domen / file.php - no access
  • domen / file.php? test = 1 - no access
  • domen / file.php? trueparam = abc & secondparam = 123 - there is access (here you need the right option)

Is it possible to do it somehow via exceptlimit or redirect rules with the F flag (or another)?

  • duck and check in RewriteCond value of %{QUERY_STRING} on \bparam= - teran

1 answer 1

Why do you need to check through .htaccess, just make a check for a get-parameter in php, if not, then give an error or redirect.

  • 1. This is a comment, not an answer: please write comments in doubt 2. If you are curious about why (and not just "it should be"), the answer may be "it saves server resources so much - you don’t need to raise a heavy PHP stream, enough on the web server itself to fight off. " - AK