OK, so I have an apache server that houses about 15 clients that all have their own URL clientX.example.com.
Each of these clients have their own conf file under /etc/httpd/conf.d/ with a VirtualHost section per below:
<VirtualHost 11.22.33.44:80>
ServerName client1.example.com
ErrorLog logs/error-client1.example.COM.log
TransferLog logs/access-client1.example.com.log
ServerAdmin webmaster@client1.example.com
DocumentRoot "/var/www/html/client1"
</VirtualHost>
So, what I really want to do is take the connection to client1.example.com and send them to the URL login.example.com/client1
I have tried several rewrites, but none seem to give the desired results of having them redirected and change the browser URL.
I have used the following lines in the above stanza:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^login\.asccontracts\.com
Rewriterule ^(client1)\.example\.com/ [
login.example.com...] [R=301,L]
I would have thought that would match my client page and sent it over to the new URL, but it never changes the URL...I still get to the docroot fine.
Eventually I would like to use a generic rule for all my virtual hosts similar to:
Rewriterule ^(.*)\.example\.com [
login.example.com...]
This seems like something so simple to do and I'm not sure where I am making a mistake.