Installation and deployment Questions on installation, system configuration and deployment to the live server.
Version 5.x > Installation and deployment > Redirect Non-WWW to WWW domain within Kentico or IIS? View modes: 
User avatar
Certified Developer v7
Certified  Developer v7
jbubriski-wakefly - 6/3/2010 9:31:34 AM
   
Redirect Non-WWW to WWW domain within Kentico or IIS?
Is there a best practice for redirecting the non-www version of your domain to the www version of your domain?

So http://mysite.com
would redirect to http://www.mysite.com

I need this so that Google correctly indexes mysite as a single site, and not as two. Can I just add a domain alias for the non-www version and set the redirect URL to be http://www.mysite.com?

What type of HTTP response would the redirect URL return? 301? I think that is what I need.

Or should I configure this in IIS?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 6/7/2010 3:05:15 AM
   
RE:Redirect Non-WWW to WWW domain within Kentico or IIS?
Hi,

You can configure this in the IIS as well. But also in Kentico CMS in Site Manager -> Sites when you edit the site you can set the domain alias as you need and set URL redirection for this domain alias.

Best regards,
Juraj Ondrus

User avatar
Certified Developer v7
Certified  Developer v7
jbubriski-wakefly - 6/7/2010 8:19:52 AM
   
RE:Redirect Non-WWW to WWW domain within Kentico or IIS?
Thanks Juraj.

What about redirecting to the non-www, with the URL path and querystring to correctly forward people?

For example, if someone tried to go to

http://example.com/blog.aspx
redirect to
http://www.example.com/blog.aspx

Is there a best practice for this scenario, and can it be done in Kentico, or would this need to be done in IIS. Thanks,,

John

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 6/9/2010 7:05:34 AM
   
RE:Redirect Non-WWW to WWW domain within Kentico or IIS?
Hi,

I am not sure if it is possible to set this in IIS but I hope so. Anyway, you can achieve this on the Kentico CMS level as well.

You will need to add custom code to the global.asax.cs file, e.g. to the Applicattion_BeginRequest event where you will check the requested URL and perform the redirection if needed.

Best regards,
Juraj Ondrus

User avatar
Member
Member
markprins - 6/24/2010 5:29:54 PM
   
RE:Redirect Non-WWW to WWW domain within Kentico or IIS?
You can create an additional site within IIS, configure the host header value for the non-www version and then set up the site as a redirect to your kentico site. This is also an option for additional domain names that you'd like to redirect to your main site.

User avatar
Member
Member
srizzetto-microgate - 6/29/2010 2:07:16 AM
   
RE:Redirect Non-WWW to WWW domain within Kentico or IIS?
You can also do in IIS.
in the Redirect To Field type
http://www.example.com$S$Q

$S is the path of the page and $Q the querystring parameter including ?