Wildcard subdomains without www

Valuco

New member
Joined
Apr 1, 2011
Messages
3
I've got a website with a lot of users, every user has his own profile. The link to the profile pages is [username].domain.tld

In the DNS records i've added the wildcard records ( A records * => Server IP)
I also added the custom HTTPD config: ServerAlias *.|DOMAIN|

It's working great, but only if i add www in front of it. When i try to reach the profile page by [username].domain.tld it gives the error that the website cannot be found.

This is my htacces file:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(^.*)\.domain.tld
RewriteRule (.*) homepage.php?id=%1
</IfModule>

As you can see, it ment to give the username as a GET value to the homepage.php file. This works only if i add the www in front of the adres.

Can anybody help me with this problem?
 
The normal error you're browser displays when a domain doesn't exists.
Cannot find server / page cannot be fount.
 
If so, then it's a DNS issue. Would you provide us with real domain name, so someone of us could check it out?
 
With the wildcard * should not be a dns problem i suppose.

Maybe a missconfiguration in httpd.conf? Can you post the virtual host you created with *.!DOMAIN|?

Regards
 
Oh, right... unlsess he removed /var/www/html/index.html file.. if so... would give the same error.

But, i suppose you are more right then me on this situation.

Regards
 
Back
Top