2

I want to restrict access using HTTP Basic Auth for a specific path so that someone visits /foo/bar will be prompted with the authentication form but not /(.*).

I use mod_rewrite so I can't put a .htaccess inside a folder as usually would do.

nocksock
  • 5,369
  • 6
  • 38
  • 63
  • Why can't you put an htaccess file in `/foo/bar`? Are there rules in a parent htaccess file that you can't simply duplicate in `/foo/bar`? – Jon Lin Jan 15 '13 at 13:08
  • 1
    Because `/foo/bar/` does not exist and I'd rather use a RegEx if possible. So that all "folders" `/foo/b(.+)` require authentication. – nocksock Jan 15 '13 at 13:43
  • Possible duplicate of [Password protect a specific URL](https://stackoverflow.com/questions/14603568/password-protect-a-specific-url) – dave Jan 22 '19 at 00:03

0 Answers0