: Htaccess redirect to public folder caught in authentication I have an .htaccess file at the root of my server which has auth on it. I have a redirect statement that upon entering example.myserver.com
I have an .htaccess file at the root of my server which has auth on it. I have a redirect statement that upon entering example.myserver.com instead of myserver.com redirects the user to a sub folder with Satisfy any in the .htaccess, BUT when using example.myserver.com the auth seems to kick in before the redirect happens, is there a way to let it see that the folder to redirect to is public?
Options -MultiViews +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.server.com$
RewriteRule ^(/)?$ subfolder [L]
AuthUserFile /var/.htpasswd #AuthGroupFile /dev/null
AuthName Welcome
AuthType Basic
require user someone
IndexOptions +ShowForbidden
ErrorDocument 401 /error401.html
ErrorDocument 404 /errorGeneric.html
ErrorDocument 500 /errorGeneric.html
and the .htaccess of the subfolder just has Satisfy any in it
More posts by @Nimeshi995
1 Comments
Sorted by latest first Latest Oldest Best
It is not wise to require authentication on your home page aka site root unless you do not want your site seen at all. You have to give people a place to land. Generally, a portion of any site would not require authentication. This gives you and your potential user the opportunity to know about your site, offerings, products, prices, access to contact and about, etc. Then the protected content would be in a sub-folder or a sub-domain.
Having placed authentication on your root takes priority over other processing. When you think of Apache there is a request process priority order. Authentication is a high priority function that I am sure trumps processing any .htaccess file.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.