views:

219

answers:

2

I've mapped 'example.com' and 'www.example.com' to the same IP address with my hosting service provider. But because my SSL certificate only works for 'www.example.com', so what I want is when the user visit 'example.com', he will be redirected to 'www.example.com'.

I'm using ASP.Net MVC and IIS 7.

Thanks

+2  A: 

I would say you should fix your canonicalization issue in the web.config file of your web application. Look here:

http://www.barrywise.com/2008/10/seo-canonical-urls-and-301-redirects-in-windows-iis-6-iis-7/

Let me know if it working.

Anvar
it works! Thanks a lot. One thing worths mentioning is that I need to install the URL rewrite module for IIS 7, it's not built in IIS 7
Nan Li
Glad to hear that. Try also this free tool from Microsoft:http://weblogs.asp.net/scottgu/archive/2009/12/15/search-engine-optimization-seo-toolkit.aspxIt would give you more insight on how healthy your web application is in terms of SEO and canonicalization as well.
Anvar