views:

223

answers:

2

I am using UrlRewriting.Net for url rewriting in Asp.Net 2 and IIS 5.1 (offline) and IIS 6 (online)

The application performs the following:

A url of the following nature: http://username.site.com is re-written as http://site.com/Default.aspx?user=username

This works perfectly online. However, I would like to know how we could test this offline.

I have tried pointing the application to 127.0.0.1 via IIS and then putting username.site.com in the hosts file to point to 127.0.0.1 - but it does not work out.

The website loads up - but the querystring is not generated.

Also tried putting just site.com -> 127.0.0.1 in the hosts file and accessing username.site.com. But in this case, the website does not load (site not found)

Any ideas?

A: 

easy way to test this will be to edit your hosts file so that username.site.com points to 127.0.0.1, but you will have to do this for each user you want to test on each PC...

d1k_is
Thanks.I've actually already tried this. However, this method for some reason returns an empty query string.The application is supposed to return me a querystring: user=username which works fine online - but not working offline.
saurabhj
A: 

Okay.

I managed to get this working. Its simple if you think about it. I got myself a DNS server, installed it on my system and configured it to serve me pages from 127.0.0.1 for site.com

If you are wondering, I used a DNS server called SimpleDNS from http://www.simpledns.com/

There is also a free BIND DNS server available from: http://oldwww.isc.org/sw/bind/view/?release=9.6.1b1&noframes=1

But that was too much for me to configure at this point of time.

saurabhj