How to redirect www to known www in Asp.net ?

anuingenious

New member
Joined
May 3, 2013
Messages
24
Points
0
I have a commercial website in Asp.net and i have to redirect my website from WWW to known WWW for Seo purpose.Is there any way to do this.
 

webdesign

New member
Joined
Jul 5, 2012
Messages
229
Points
0
I have a commercial website in Asp.net and i have to redirect my website from WWW to known WWW for Seo purpose.Is there any way to do this.
Hello, I found a topic on Webmaster Sun relate to problem you want to ask
https://www.webmastersun.com/threads/2836-301-Redirect-in-htaccess-PHP-and-IIS

Try to use ISS tips in thread above or you can use code

Code:
if (Request.Url.ToString.IndexOf("www") < 0)
{
	Response.redirect("http://www." + Request.Url.ToString.Remove("http://"));
}
Use this code in application_beginrequest event of Global.asax

Good luck!
 
Older threads
Replies
2
Views
2,809
Replies
0
Views
5,077
Replies
0
Views
2,264
Replies
2
Views
14,246
Newer threads
Replies
1
Views
2,640
Replies
0
Views
2,154
Replies
2
Views
2,655
Latest threads
Replies
0
Views
29
Replies
0
Views
31
Replies
1
Views
41
Replies
3
Views
106
Recommended threads
Replies
0
Views
2,342
Replies
10
Views
5,702
Replies
10
Views
5,039
Top