My Apache is rusty but I've been struggling just trying to create an admin on a shared hosting server for a client.
This is an old code igniter site and the PHP can specify where to go based on the URL.
In .htaccess, I'm trying to rewrite with:
RewriteCond %{HTTP_HOST} ^staging\.admin\.example\.com$
RewriteRule ^$ "http\:\/\/staging\.example\.com\/admin\.index\.php"[L]
At the moment, I'm only trying to get this far without a 500 error.
Afterwards though, I want to protect the admin area, for which I intend to try:
SetEnvIf Host admin.staging.example.com passreq
AuthType Basic
AuthName "Password Required"
AuthUserFile /home/user/.htpasswds/admin.staging.example.com/.htpasswd
Require valid-user
Order allow,deny
Allow from all
Deny from env=passreq
Satisfy any
I'm now told that the hosting provider will enable mod_env at the same time they move us to a server that will allow SSH login (I insist on this).
This is Apache 2.4. Can anybody see where I'm going wrong, or have an alternate suggestion?
Thanks! Chris