I'm looking for a htaccess/conf modification that will forward any and all subdomains to the same location (eg: to the main www location), but keep the same subdomain. Possibly something like *.my.dom => /public_html/ ?
Also, I'd like to be able to forward "my.dom" to "www.my.dom" if there isn't a subdomain present.
Many thanks in advance.
Point any and all subdomains to the same location - Apache
Moderator: General Moderators
Unless I'm mistaken, you have to have a DNS entry for each subdomain. In other words, wildcards won't work. You'd have to use each subdomain redirection.
e.g.
redirect sub1.my.dom to http://www.my.dom
redirect sub2.my.dom to ...
There's no need for a www in front, though. The www is the biggest piece of garbage I've ever seen. A waste of four character spaces.
e.g.
redirect sub1.my.dom to http://www.my.dom
redirect sub2.my.dom to ...
There's no need for a www in front, though. The www is the biggest piece of garbage I've ever seen. A waste of four character spaces.
That's highly unlikely. You should be able to point any and all subdomains through Apache's httpd.conf.
After rooting around, I was able to modify my windows hosts file to allow a fake domain + subdomain, but it doesnt have a wildcard character that I can find. Furthermore, I found...
but it doesn't matter if I comment that out or not, it doesn't effect it. So, it shouldn't exactly be through Apache, but possibly through a DNS manager. I'll check into what my server has.
After rooting around, I was able to modify my windows hosts file to allow a fake domain + subdomain, but it doesnt have a wildcard character that I can find. Furthermore, I found...
Code: Select all
<VirtualHost *.domain.ext:80>
ServerAdmin webmaster@www.domain.ext
DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"
ServerName www.domain.ext
ErrorLog logs/www.domain.ext-error_log
CustomLog logs/www.domain.ext-access_log common
</VirtualHost>