This is linked to Rewriting subdomain.domain.com when other 'subdomains' exist
I need mod_rewrite to 'stop' processing, but it seems to continue on.
On my registrar, I've set A records as:
* 12.34.56.78
@ 12.34.56.78
mgr 12.34.56.79 [it was working, and is working]
dbaccess 12.34.56.79 [this is something new I added]
My httpd.conf looks like this now:
<VirtualHost 12.34.56.79:80> // notice the 79 which is something I'm trying out!
ServerAlias dbaccess.example.com
DocumentRoot /var/www/html/dbaccess
ServerName dbaccess.example.com
</VirtualHost>
NameVirtualHost 12.34.56.78:80
<VirtualHost 12.34.56.78:80>
ServerAlias *.example.com // trying to catch science.example.com
DocumentRoot /var/www/html/site
ServerName www.example.com
<IfModule mod_rewrite.c>
RewriteEngine On
...
RewriteCond %{HTTP_HOST} ^science\.example\.com [NC]
RewriteRule (.*) http://www.example.com/classes/science/280.html [R=301,L]
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
...
</VirtualHost>
// this is needed for other purposes
Listen *:2194
<VirtualHost *:2194>
Redirect / http://mgr.example.com/
</VirtualHost>
Here is what works and what doesn't:
http://www.example.com/ works fine
http://mgr.example.com/ works fine
http://science.example.com/ works fine
http://dbaccess.example.com/ does NOT work fine
Accessing dbaccess.example.com redirects me to www.dbaccess.example.com (the same if I do doesnotexist.example.com which gets redirected to www.doesnotexist.example.com )
How do I get dbaccess.example.com to show contents of /var/www/html/dbaccess ?