Solved

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

Posted on 2009-03-29
4
752 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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

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.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
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…

630 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