0

I am trying to password protect one URL on a Magento site.

I have my .htpasswd setup

I have tried using the directive - NO LUCK. I also tried the following:

SetEnvIf Request_URI ^/url-name require_auth=true
AuthType Basic
AuthName 'By Invitation Only'
AuthUserFile /var/www/vhosts/path/.htpasswd

Order Deny,Allow
Deny from all
Satisfy any
Require valid-user
Allow from env=!require_auth

But when I do the above it ends up doing the entire site. I am putting everything right before the tag

1

I don't see a way to do this in .htaccess. You define the authentication, so it applies. You are doing this at the Directory level, so you can't use location here.

If you do not have access to the apache main configuration, then I would use authentication in php and use a rewrite rule to match the url and rewrite it to that file.

But once you are down that path you may as well extend the Magento product class to an authenticated product. That way you can implement it without worrying about server implementation and you can use customer groups to implement different "preview" campaigns that can run along side each other.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.