Wildcard subdomains not working

955 views Asked by At

I'm trying to set up wildcard subdomain to access user's blog of my application with url like: "user.blog.dev".

But all I get is an error "Connection timed out". I have no problems when I go to "blog.dev"

Here is my host file

255.255.255.255 broadcasthost
::1             localhost
127.0.0.1       bloggus.dev

My httpd-vhosts.conf

<VirtualHost *:80>
         DocumentRoot "/Applications/MAMP/htdocs/BlogCreator/public"
         ServerName bloggus.dev
         ServerAlias *.bloggus.dev
</VirtualHost>

I appreciate your help as I'm getting so crazy with this, my conf just look like what I found on the internet I don't see any mistakes.

1

There are 1 answers

2
MrTux On

You only made apache wildcard subdomain aware. However, you did not set up hostname to IP resolution for all subdomains.

You have to put each subdomain explicitely in your hosts file (or set up a wildcard subdomain on a DNS server responsible for your domain).