Click here to Skip to main content
15,881,204 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: , +
i want to redirect XXXXXXX.com to www.XXXXXXX.com i have done this on html and php but this one is on dotnet .. and i am not able to understand
also how to redirect the post link named as /Default.aspx to website URL

What I have tried:

I have tried many things but they didnt work as its my first time on Dot Net please help me out guyz
Posted
Updated 21-Mar-17 7:26am
v2

Here is an example to redirect XXXXXXX.com to www.XXXXXXX.com
Scott Forsyth's Blog - IIS URL Rewrite – rewriting non-www to www[^]

Here is an example on how to redirect
How to: Redirect Users to Another Page[^]
 
Share this answer
 
Comments
Hammad Khan 24-Mar-17 5:51am    
thanks a lot buddy .. it worked ... but i am still getting the same page with and without this Default.aspx is there any solution for it ??
www.southdelhiadvocate.com/Default.aspx
Bryian Tan 24-Mar-17 9:41am    
can you explain the scenario?
use Response.redirect() method to redirect from one page to another page or can redirect to external Url.

Ex: Response.Redirect ("one.aspx");

External Site:

Response.Redirect("www.codeproject.com");
 
Share this answer
 
Comments
Hammad Khan 23-Mar-17 6:25am    
where i need to use this ? if i want to redirect the default.aspx page so it should be used or in body or somwhere else ?
Ramesh Kumar Barik 23-Mar-17 13:52pm    
If you want to redirect to another page on button click then u need to write the this Response.Redirect("YourPage.aspx") / Response.Redirect("www.codeproject.com") method in button click event.
Hammad Khan 24-Mar-17 7:47am    
thanks a lot buddy .. it worked ... but i am still getting the same page with and without this Default.aspx is there any solution for it ??
www.southdelhiadvocate.com/Default.aspx
Ramesh Kumar Barik 24-Mar-17 11:04am    
Yes you can redirect to other external sites like mentioned site.
Same syntax you can use to redirect from you application.

Ex:
Response.Redirect("http://www.southdelhiadvocate.com/Default.aspx")
Add http:// before your link.

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