Reputation: 1322
So, say I have a proxied url whatever.com
that actually is proxied to show content from whatever.mydomain.com
. whatever.mydomain.com
then has a basic auth directory
<Directory /var/www/html/stuffs/internal>
AuthType Basic
AuthName "mumbo-jumbo"
AuthUserFile /etc/apache2/.htpasswd
Require valid-user
</Directory>
When the user hits whatever.com/internal
the login form is displayed, but after logging in, they get sent to whatever.mydomain.com/internal
for the content. How could I keep it so that after the login, the user is sent to the proxy url aswell? Or atleast make it seem so to the end user?
Upvotes: 1
Views: 79
Reputation: 178
It can we solved by putting RewriteRule
after Directory.
<Directory />
AuthType Basic
AuthName "Restricted Files"
AuthUserFile /etc/apache2/.htpasswd
Require valid-user
</Directory>
RewriteCond %{LA-U:REQUEST_URI} !^$
RewriteRule ^/(.*) http://whatever.mydomain.com/$1 [P,L]
Upvotes: 1