I have a site in production that I want to modify (translate from French to English). The modified part will be placed in the domain.com/en
URL location and I want to protect only this part with a basic HTTP auth during the modifications.
I would like to have the same behavior as if I had a en
directory on my web root folder, and a .htaccess
file on this directory to implement basic auth. Unfortunately, I can't do this because The site runs on WordPress and uses Rewrite Rules, so I cannot create a en
directory without bypassing WordPress.
What directives should I put in the .htaccess
in the root directory to enable basic auth only for the /en
location ? I tried using the <Location /en></Location>
block, but it produces a 500 error so I suppose this block is only supported in apache configuration files.
Best Answer
I see... The code below will disable auth on only the callbacks directory, perhaps you can modify this logic so that it only enables authentication on the desired directory, or disable auth on all dirs whose name doesn't match the one you wish to protect.