: Make all subdomains load the same page, how is it called/done? Is there a way to make all subdomains show the same page. I got the idea somewhere you could have a page like idk information.com
Is there a way to make all subdomains show the same page.
I got the idea somewhere you could have a page like idk information.com and if an user typed miami.information.com he would get information from that city.
Is there a way to do it?
Like making the site retrieve the first part of the subdomain and search it on the site.
More posts by @Harper822
1 Comments
Sorted by latest first Latest Oldest Best
The final configuration depends on the web server you'll be using but in Apache httpd you'd simply create a wildcard virtual host:
<VirtualHost *:80>
ServerName example.com
ServerAlias *.example.com
# other configuration directives
</VirtualHost>
Prerequisite is that there's a *.example.com A (or CNAME) resource record in your zone for example.com. Ask your name server administrator about it.
In your PHP scripts you can then simply evaluate $_SERVER['HTTP_HOST'] to get the first component of the hostname.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.