Mobile app version of vmapp.org
Login or Join
Bryan171

: HTACCESS Wildcard Subdomain forward to Domain I know this may seem like a duplicate, but I am unable to find a solution. Is it possible to setup wildcard subdomains with htaccess? I have an

@Bryan171

Posted in: #301Redirect #DomainForwarding #Htaccess #ModRewrite #Redirects

I know this may seem like a duplicate, but I am unable to find a solution.
Is it possible to setup wildcard subdomains with htaccess?

I have an example of
test.domain.ca I need to forward to www.domain.ca
I don't have specific 'sub-domains'. so I would need a form of a wildcard. Is this possible to do through HTACCESS?

Any help is appreciated.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Bryan171

2 Comments

Sorted by latest first Latest Oldest Best

 

@Megan663

Short answer: No, it's not possible to setup wildcard subdomains with .htaccess.

To achieve what you want to do, you need to have a wildcard record in your DNS zone file, because your nameserver is where the subdomains are looked up. Also, many hosting companies will not allow you to add a wildcard record, so you'll have to check with them.

10% popularity Vote Up Vote Down


 

@LarsenBagley505

Do you actually have a * wildcard record in your DNS zone file? If yes then all you need to do is add an A record into the zone file and point it to the IP hosting your domain.ca now all connections to that specific sub domain will go to domain.com while the other wildcard subdomains will go some place else.

Or in cPanel you would simply create your test subdomain.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme