-1

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.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
181mdz
  • 133
  • 1
  • 1
  • 10

1 Answers1

1

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).

MrTux
  • 32,350
  • 30
  • 109
  • 146
  • it is possible to achieve what i want only with htaccess ? i dont want to write vhost for each blogs.. this is a school project so i have to work on local environnement. – 181mdz Jun 23 '15 at 19:10
  • 1
    The apache part is not the problem. Your browser can't resolve the hostnames as those are not added in the hosts file. – MrTux Jun 23 '15 at 19:56