Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > How to customize content for domain aliases View modes: 
User avatar
Member
Member
alberto-atodesign - 3/30/2012 6:31:12 AM
   
How to customize content for domain aliases
In kentico is possible to add a domain aliases for different cultures and display the right language. For example if users digits http://fr.mysite.it they see the french version of www.mysite.it
But is there a similar behaviour where the domain aliases determine the page content and layout?
We need to display a different content (and sometimes layout) for visitors that browse our site with different domain aliases (as well as it happen with cultures).
For example if we have the site kb.mysite.it and kb.mysite2.it we need to display the same content with little custom differences: "welcome to mysitetext !" if visitors browse "kb.mysite.it" and "welcome to mysite2text !" if visitors browse "kb.mysite2.it"
The same for images "see my prefered picture of mysite <img src="mysite.jpg" />" or "see my prefered picture of mysite2 <img src="mysite2.jpg" />" in case users browse kb.mysite.it or domain aliases kb.mysite2.it
At the same, is it possible don't display pages or document for visitors that browse the one or the other domain aliases? or don't display one or more cultures for visitors that browse the first or the second domain alias?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 4/3/2012 1:19:10 AM
   
RE:How to customize content for domain aliases
Hi,

You can configure the domain aliases of your site in Site Manager -> Sites -> edit your site -> Domain aliases tab. There, you can set the default culture for given alias and also the URL redirection - so, you can redirect the user to given document if she types that domain name.

Regarding the texts - you can use macros as well as for the images (or, just use different page template for each language version just with that modification you need).

Best regards,
Juraj Ondrus

User avatar
Member
Member
alberto-atodesign - 4/3/2012 3:49:12 AM
   
RE:How to customize content for domain aliases
Thank you for you answer!

But our problem is little different: we need to display different content in case of different host domain aliases (the culture is the same for all aliases). It seems that kentico support domain aliases only for languages and not for other purposes.
We need similar behaviour but not changing culture.
You suggest to use Macros, but it seems macros identifing document path and not document for domain aliases. Can you help us or suggest us some work-around? (we are using Kentico 5.5R2)

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 4/3/2012 6:53:42 AM
   
RE:How to customize content for domain aliases
Hi,

in code of your custom macro you can check the current domain. For this you can use code


string host = URLHelper.Url.Host; //this works in 6.0 version

string host55 = UrlHelper.Url.Host; //this is code for 5.x version


Best regards,
Ivana Tomanickova