Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mezie's avatar

Wildcard subdomain routing

I follow Jeffery Way lesson on wildcard subdomain but my app not working as intended. I have already done the subdomain routing in my routes.php and set wildcard subdomain in my domain registrar. I don't know what am doing wrong here. Here is a link to the site: mylungu.com. If I enter something like funaab.mylungu.com in the browser, I keep getting godaddy default coming soon page but if I enter www.mylungu.com it works the way I want by getting the subdomain part (in this case www). Any please on this will be appreciated, spend over a week trying to to figure this out.

0 likes
19 replies
jakeryansmith's avatar

Did you set up wildcard subdomains on your DNS? And also on your server?

mezie's avatar

I set up wildcard subdomains on domain registrar DNS but not on the godaddy since I didnt register the domain with them.

sid405's avatar

Setup a CNAME record on Godaddy.

Either with

  • funaab pointing it at @
    • pointing it at @

Don't forget that in either case on your webserver you have to accept ad handle these subdomains.

mezie's avatar

@sid405 won't setting up a CNAME with funaab limited cos I want wildcard subdomains

mezie's avatar

@sid405 I already setup * subdomain in my domain registrar DNS, do I need to set it up again in godaddy?

jakeryansmith's avatar

You have to set it up in 2 places: First your DNS needs to know which server to point *.mylungu.com too. Once it hits the server, the server needs to take that and decide which site to point it to. So yes, you need to set it up on your go daddy server as well.

sid405's avatar

ok.

So who's your registrar? Where are you hosted? What Webserver are you using and can you modify webserver configs on your host?

mezie's avatar

registrar is whois.com and host is godaddy. I don't understand what you mean by webserver

mezie's avatar

I have setup * subdomain at both registrar DNS and at godaddy but still the same.

sid405's avatar

Well you're gonna have to tell your host where your Laravel app is , that the webserver needs to redirect all subdomains to your Laravel app. That is who you achieve that.

There is no other way for the webserver (being apache, lighttpd or nginx) to know that you're trying to place all subdomains in the same place.

Are you on shared hosting or VPS?

mezie's avatar

Apache and am on a shared hosting

sid405's avatar

Can you modify the apache VirtualHost Config? Because that's what you want. Or through some interface tell Godaddy to expect all subdomains for that domain.

I'm sorry i can't help you by example man, but i've never worked with GoDaddy as a host.

mezie's avatar

I have ssh access where is the apache VirtualHost Config located.

ravidaparthi's avatar

Your site not yet all working properly...showing error while posting ad

Please or to participate in this conversation.