Installation and deployment Questions on installation, system configuration and deployment to the live server.
Version 5.x > Installation and deployment > Domain Alias Redirection View modes: 
User avatar
Member
Member
Blake - 8/26/2010 10:09:44 AM
   
Domain Alias Redirection
I'm wondering if the domain aliases can be used to redirect any traffic to a non-www request to the matching page on the primary www domain on site.

For example, i have the site setup as:
Site Domain Name: www.company.com

I have an alias setup for:
company.com

I would like to take any traffic that was directed to http://company.com/page.aspx and redirect it with a 301 ideally to http://www.company.com/page.aspx

Under the company.com alias, setting the redirect url to http://www.company.com/ takes any traffic to http://company.com/page.aspx and redirects it to the specific URL of http://www.company.com/. Is there any undocumented wildcard matching that could be placed in there, or is there another method that's as easy to do?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 8/27/2010 5:16:38 AM
   
RE:Domain Alias Redirection
Hi,

What are the settings for the site and its aliases in Site Manager -> Sites -> edit your site -> Domain aliases tab? You can set the Redirect URL for given alias here.

Also, you can set this redirection already on the IIS level, before it reaches Kentico engine.

Best regards,
Juraj Ondrus

User avatar
Member
Member
Blake - 8/27/2010 7:35:12 AM
   
RE:Domain Alias Redirection
As I mentioned in my post the Settings under Domain Aliases tab are:

Under the company.com alias, setting the redirect url to http://www.company.com/ takes any traffic to http://company.com/page.aspx and redirects it to the specific URL of http://www.company.com/.


It's catching all traffic and redirecting it to the single page rather than to the corresponding page on the primary domain. I'm just looking to see if there is a Kentico solution as we won't always have control over the IIS settings in some cases.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 8/29/2010 10:14:35 AM
   
RE:Domain Alias Redirection
Hi,

If I am getting the right meaning, you want to redirect the user every time to a different page within the domain. I mean that if someone types address company.com/somepage.aspx you want to redirect this request to the same page (somepage.aspx) on www.company.com domain. If so, you need to handle the requests in code of global.asax.cs file in App_Code folder and e.g. in Application_BeginRequest event and catch the requested URL and do the 301 redirection to the same page but on desired domain.

Best regards,
Juraj Ondrus