Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to implement Url masking. for example .

I have one website www.abc.com/Login.aspx when user enter this URL in browser he will be redirected to www.xyz.com/Login.aspx.

But i want to show user the previous URL i.e. www.abc.com in the browser.

I have many URL like abc.com for which user will be redirected to xyz.com ,i want to know from which URL was Redirected to xyz.com

and also how to hide URL of xyz.com

Thanks in advance.
Posted

You should use URL rewriting techniques.

Refer-
1. IIS URL Rewrite – Redirect multiple domain names to one[^]
2. 10 URL Rewriting Tips and Tricks[^]
 
Share this answer
 
If you are using ASP. NET MVC you can play with the route system and map an url to some route. You could probably get the effect that you required.
 
Share this answer
 
Using IIS Url Rewrite is best possible way to redirect to another domain at very early stage, when request is just going to process. Another way could be write managed module in IIS.

Are you using sub-domain as source or all are primary domain, means www.abc.com, www.xyz.com etc?
 
Share this answer
 
Comments
rahul rangrao shinde 13-Nov-13 2:57am    
Actually we plan to use sub domain like www.mumbai.abc.com
Himadri Majumdar 13-Nov-13 4:09am    
In that case actually you have no need to physically create sub-domain. You can use Application Request Routing Module 2 to achieve the same. You just need to add one rule which does what you wanted to do. If I understand it correctly you want below cases.

www.abc.mydomain.com -> www.mydomain.com/abc
abc.mydomain.com -> www.mydomain.com/abc
www.xyz.mydoamin.com -> www.mydomain.com/xyz
xyz.mydomain.com -> www.mydomain.com/xyz

You can follow http://forums.iis.net/t/1155754.aspx

<rule name="SubDomainRedirect" stopprocessing="false">
<match url="(.*)">
<conditions>
<add input="{HTTP_HOST}" pattern="^(?!www)(\w+)\.mydomain\.com$">

<action type="Rewrite" url="{C:1}/{R:1}">
rahul rangrao shinde 13-Nov-13 5:15am    
all request like www.mumbai.abc.com will redirect to www.xyz.com where application hosted.

I want to show the url of www.mumbai.abc.com but in real it will use webpages hosted on www.xyz.com

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