.htaccess - Wildcard subdomains, block all other -
i'm having few issues new vps bought. i'm trying configure apache accept wildcare subdomains on main website, allowing means can't block others except 1 created.
to more explicit, i'm having this:
subdomain1.domain.com -> redirects correctly (cname added, folder ok, ok) subdomain2.domain.com -> same subdomain1
subdomainn.domain.com -> subdomainn doesn't exist. thus, if write "stackoverflowreallyrocks.domain.com" i'm being redirect stackoverflowreallyrocks.domain.com, content of domain.com - isn't good.
is there way redirect subdomains doesn't exists domain.com?
the httpd.conf main domain is:
<virtualhost *:80> documentroot "/home/domain" servername www.domain.com serveralias domain.com </virtualhost> <virtualhost *:80> servername subdomain1.domain.com documentroot "/home/domain/_subdomain1" </virtualhost> <virtualhost *:80> servername subdomain2.domain.com documentroot "/home/domain/_domain2" </virtualhost>
try adding virtualhost bottom of config:
<virtualhost *:80> servername * serveralias * </virtualhost> the other virtualhost entries should still match better matches, , prior wildcard host, allowing non-matching requests fall last virtualhost
Comments
Post a Comment