Solved

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

Posted on 2009-03-29
4
740 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
Comment Utility
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
Comment Utility
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 500 total points
Comment Utility
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
Comment Utility
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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Join & Write a Comment

Developer tools in browsers have been around for a while, yet they are still heavily underused by developers. Developers still fix html or CSS then refresh page to see effect, or they put alert or debugger in JavaScript and then try again and again …
Thoughout my experience working on eCommerce web applications I have seen applications succumbing to increased user demand and throughput. With increased loads the response times started to spike, which leads to user frustration and lost sales. I ha…
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now