Question

I´m not sure if this is really a programming question, but it's related to what I'm doing which is... I'm developing a web site that will have a lot of .domain.com, and based on what contain, the web site will show diffrent content.

Anyone knows how to do that? Maybe it requires changes in the DNS server.

Was it helpful?

Solution

You need a wildcard DNS entry to point all of those subdomains to the same IP (the one your web server uses). Then sort it out in your application code which site to show based on the host header.

OTHER TIPS

After you have the DNS entries all pointing to the same box, you can use Apache virtual hosting to make them behave and appear as separate web servers, without the overhead of multiple Apache instances.

After setting the dns to point all the subdomains to the same IP, you can also configure Apache to rewrite the url to route the request. (http://httpd.apache.org/docs/2.2/misc/rewriteguide.html). That is, if you're into Apache =)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top