We are setting up custom subdomains for all of our website users. This could end up being in the tens of thousands, maybe more. Each user will get one and only page on our website, and they can view it by going to this URL:
username.OURDOMAIN.COM
We are going to setup each user's HTML file in a folder on the server, so the HTML code for each user would actually be stored some place like this:
/USERPAGES/username1.htm
/USERPAGES/username2.htm
/USERPAGES/username3.htm
etc.
When someone types in username.OURDOMAIN.COM we don't want them redirected, we want them to just see that domain in their browser, but have Apache serve up the page /USERPAGES/username.htm
Basically Apache needs to pull out the subdomain and know that the file for that user is stored somewhere, retrieve and serve it.
I'll explain what we need to do again using * for a wildcard character to make sure I'm explaining this properly:
*.OURDOMAIN.COM
would cause Apache to automatically serve this page:
/USERPAGES/*.htm
Pages will all be subdomains of the same domain on the same IP, and I can't define them all separately since there will be thousands of them. I need some sort of wildcard driven configuration to do that all automatically.
What is the simplest way to accomplish this? Do I use MOD_REWRITE or something else to do this? Would appreciate any suggestions!
Best wishes,
- Jeff