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?
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?