Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Local testing for sub-domains using Url rewriter, Asp.Net 2

Posted on 2009-03-29
4
Medium Priority
?
770 Views
Last Modified: 2012-05-06


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?
0
Comment
Question by:sajain84
  • 2
  • 2
4 Comments
 
LVL 22

Expert Comment

by:cj_1969
ID: 24038665
each is a unique host name ... try entering both into the hosts file pointing to the same IP.
0
 
LVL 3

Author Comment

by:sajain84
ID: 24038923
Thank you for your inputs.

I've done exactly that.
My host file is as below:

Even with this, it does not work.

127.0.0.1    localhost
127.0.0.1    mysite.com
127.0.0.1    blah.mysite.com

Open in new window

0
 
LVL 22

Accepted Solution

by:
cj_1969 earned 2000 total points
ID: 24039026
You could try running a DNS server on your workstation.
https://www.isc.org/software/bind ... there is one for Windows
If you do this, you can create a new dummy domain to test with.  Configure the hosts that you want to test with in the new domain and then just set the forwarder in the DNS service to your real DNS server and all other domains should resolve as normal.

If this is a DNS issue and the applications interaction with the name then this should resolve the problem.
0
 
LVL 3

Author Closing Comment

by:sajain84
ID: 31564190
Awesome! It worked.
However, I used another DNS Server as BIND was too much to configure.

I got SimpleDNS from: http://www.simpledns.com/
Thats a 14 day trial but a lot more time than I need.

Thanks again!
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
This video teaches users how to migrate an existing Wordpress website to a new domain.

879 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question