Click here to Skip to main content
15,664,272 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
How do I rewrite a URL like to Is it possible to do a rewrite like sub domain.

After rewriting the subdomain like it must open a page.aspx page...

I have tried lots of things but nothing is working...

There is lots of posts about rewriting a url as sub domain but nothing is working properly.
Can anyone give me a perfect solution?
Updated 10-May-15 12:28pm

I don't think it's possible. If it was possible, it would confuse the domain resolution, which should happen before the HTTP request is sent to the server. And to make the rewrite engine come in to play, you have to have HTTP request with URL already dispatched to the server where this rewrite engine works. If the actual sub-domain does exist, the request will be sent to that sub-domain, won't reach you rewrite engine; and if it does not exist, the request will go nowhere and won't reach the rewrite engine anyway. You should come to the same conclusions if you study how DNS works with HTTP and the operation of rewrite engines:[^],[^],[^].

Share this answer
Hi Aarti,

I can suggest you one way to achieve your requirement upto some extent. There is a concept like URL REWRITING. Using this concept you can able to achieve some portion of your requirement. You can able to mask some of the portions of the URL like querystring and can achieve the goal you are trying to do. Here is a very god URL which will help you understanding in depth follow below.


Hopw this will help you to achieve your goal.

Thanks & Regards
Sisir Patro
Share this answer
Aarti Yadav 30-May-15 2:30am    
i have solved by global asax without rewriting .. its work great..
yeahhhhh :)
[no name] 15-Sep-15 5:00am    
You should share your ans how you have resolved it so that someone else facing same issue will get it be done with ur solution.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900