Installation and deployment Questions on installation, system configuration and deployment to the live server.
Version 5.x > Installation and deployment > Default alias path and automatic redirect View modes: 
User avatar
Member
Member
michiel - 7/9/2010 4:39:59 AM
   
Default alias path and automatic redirect
What's the best way to automatically redirect visitors from the root to the default alias path? The same way it happens on http://www.kentico.com which redirects to http://www.kentico.com/home.aspx

Thanks!

User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 7/12/2010 3:37:40 AM
   
RE:Default alias path and automatic redirect
Hello,

the recommended way (which we use on our site) is setting that via Default Alias Path property in Site Manager -> Settings -> Your_Site -> Web site.

Best regards
Ondrej Vasil

User avatar
Member
Member
michiel - 7/12/2010 7:58:32 AM
   
RE:Default alias path and automatic redirect
Hi, thanks for your reply.

I have set the default alias path, but it seems that only controls the content of the page. So if someone visits the root of the site, it will display the content of another document as the root document. It doesn't actually redirect to the other document, it stays at the root of the site.

On kentico.com all visitors are redirected to /home.aspx

Is that programmed, or is there a setting that does the redirect?

User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 7/22/2010 3:55:01 AM
   
RE:Default alias path and automatic redirect
Hello,

That's my bad, I apparently forgot to mention that you need to have set Redirect document aliases to main URL property set to true (URLs and SEO). This does the trick.

To be honest, on the Kentico.com site, there is another redirection (probably due to historical reasons) which is done most probably in ~\App_Code\Global.asax.cs file. This is another way of achieving this goal. You can put custom redirection code to the Application_BeginRequest method.

Hope it helps.

Best regards
Ondrej Vasil

User avatar
Member
Member
michiel - 7/22/2010 7:40:43 AM
   
RE:Default alias path and automatic redirect
Hi,

thanks for the update. I have tried that setting, but on my local machine a pretty much clean install of 5.5 with hotfix 5.5.9 applied does not redirect to /home with the settings you mentioned (those settings being Redirect document aliases to main URL and Default alias path).

I think the reason this doesn't actually work is because the setting Default alias path is not related to the setting Redirect document aliases to main URL. The first is with regard to content (so it means display the content of this selected document on /) and the second is with regard to URL (so it means always go the the main URL which is an attribute of the document).

Do you want to hear something even stranger? One of our live sites (http://www.breedwelzijndelft.nl) does redirect to /Home automatically, but it has Redirect document aliases to main URL set to false... no code added to global.asax.

Unfortunately I have no idea why it redirects or how I did that :p

User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 7/29/2010 7:39:50 AM
   
RE:Default alias path and automatic redirect
Hello,

I tested it a bit further and find out that Document alias needs to be different from Document URL Path. In case you have set Use custom URL path to false, you will need to set different Document name to inherit correct Document URL path.

At any rate, I'm passing that as a bug to our developers and testers will debug it deeply to find out possible issues.

Best regards
Ondrej Vasil