0

My website has a search protocol, but it is only for site admins. I want to be able to share certain searches with users without them having to log in (since queries are hashed, they won't be able to search anything from the URL).

I am using basic auth and need to find a way to exclude all query strings from password protection. The file is index.php, which I want password protected, but I want index.php?q=* (wildcard), open to all. Is there a way to do this with only .htaccess?

Since it is a query string, it is not a directory. I've looked around for something, but they have all been to password-protect query strings, etc.

  • 1
    Possible duplicate of [htaccess exclude one url from Basic Auth](https://stackoverflow.com/questions/8978080/htaccess-exclude-one-url-from-basic-auth) –  May 24 '18 at 03:51
  • See https://stackoverflow.com/questions/14603568/password-protect-a-specific-url – gregjor May 24 '18 at 04:00
  • @smith Those will not work because for me, the query is under the same file (index.php) and if I allow auth to that, they people will be able to search. It will not let me do wildcards. – Shrey Gupta May 24 '18 at 04:13
  • @gregjor Please see above – Shrey Gupta May 24 '18 at 04:14
  • it will work, its a regular expression check on the url you just have to add your "q?*" in to it –  May 24 '18 at 04:14

0 Answers0