php - Redirect and URL Mask all non-existing/existing subdomains to homepage -
a website example.com has 1 subdomain a.example.com. point here want redirect existing , non existing subdomain (ex- b.example.com) example.com without changing url(url mask). explain more further, when user enters b.example.com must see example.com on screen url must not change b.example.com --> example.com. think possible .htaccess file failed achieve it.
do need configure virtual host. since have access .htacces, wish can done
you need have 2 things configured correctly:
- a dns entry wildcard (*.example.com -> server ip)
- a virtual host wildcard alias (
serveralias *.example.com
)
then there nothing in .htaccess. .htaccess alone can't want. , please note seo-toxic (duplicate content), depends on use case.
as not have access virutal hosts config, may go subfolders instead of subdomains.
Comments
Post a Comment