Solved

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

Posted on 2009-03-29
4
749 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 500 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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.
It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
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.
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

734 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