PDA

View Full Version : All subdomains to point to 404


DarkStreetDev
11-30-2007, 10:42 AM
Hi,

I am looking to point all requests to non-existent subdomains for a site to one page, e.g. if a user types:

http://mytest.domain.com

It should point to a certain file. Easy enough to setup 404's on the main account for mistyped URL's but if a subdomain is specified it doesn't work so well.

Essentially in the end I would like to get the subdomain typed and based on that display a page for that user, e.g. http://user1.domain.com will bring up a custom page for that user (I get the user details from DB based on subdomain/username).

Please note I don't want a redirect, e.g. a URL like this should work:

http://user1.domain.com/myaccount/edit.asp

and for another user they will access their account page using:

http://user2.domain.com/myaccount/edit.asp

Basically the same as blogspot users, e.g. user.blogspot.com

I am using IIS and ASP.

Any help will be greatly appreciated.

darksidepuffin
11-30-2007, 01:07 PM
You'll have to use whatever the IIS equivilant of rewrite rules is. Sorry, I'm not familiar with IIS, so I can't be more specific.

DarkStreetDev
12-01-2007, 02:13 PM
I will probably have to use ISAPI Rewrite but I'm not sure which rules will achieve what I am looking for? Apparently the syntax is identical to Apache's mod_rewrite so if anybody can do this using that, it would also be really helpful.