Multilingual with sub directories - set default root page
Hello,
I've tried to build up a new site with multiple languages without use of subdomains. So I want my language versions to be accessible through:
www.mysite.com - default version (german)
www.mysite.com/de (german)
www.mysite.com/en (english)
So I created a homepage "de" and a homepage "en" for both versions (and hostnames with /de and /en), as well as a parent site holding both of them. My structure now is:
Content
-- MySite
---- de
------ Produkte
---- en
------ Products
Because of I used a empty page "MySite" for organizational purposes (if there are additional sites in future), I have the problem that if I go to the root domain without directory, I get an empty page (= the MySite page). How can I point to the de Homepage by default without doing a manual redirect?
I've tried to add the hostname www.mysite.com to the de page, but then the culture/language is ALWAYS set to german (so It overrides language for en pages). How to solve that?
Add an umbracoInternalRedirectId property of type contentPicker to your MySite page document type and have it set to the /de page, so it will redirect to that page upon entering the www.mysite.com
I have a form in the Master Page template which should post to the specific search page. Is it right to store the search page path as Dictionary entry to set the form action dynamically?
you could use dictionary items, but wouldn't recommend that in case someone changes the name of the page.. which would make the url turn into a 404...
Add an extra property on the 'en' and 'de' page (content picker) and use it to retrieve the page from xslt or from within your template (depending on how you're building up the form)
The form action will go to www.mysite.com/en/solutions/1234.aspx (not working) instead of www.mysite.com/en/search.aspx
How to get that (current language sub directory & nice page name) using a page field in a template? Do I need a XSLT macro to convert the page template to the right URL format? (1234 -> /en/search.aspx)
using umbracoInternalRedirectId for my root page mapping to the default language homepage (e.g. /de), this page is then accessible via the following TWO urls:
So since its a transparent redirect (using umbracoInternalRedirectId), also search engines doesn't recognize this, which may be a disadvantage concerning SEO?!
What do you think? Would it be better to get REALLY and visibily redirected to /de (the default language) to avoid that there are 2 URLs which provide exactly the same contents? How do others handle that on their multilingual sites?
Multilingual with sub directories - set default root page
Hello,
I've tried to build up a new site with multiple languages without use of subdomains. So I want my language versions to be accessible through:
www.mysite.com - default version (german)
www.mysite.com/de (german)
www.mysite.com/en (english)
So I created a homepage "de" and a homepage "en" for both versions (and hostnames with /de and /en), as well as a parent site holding both of them. My structure now is:
Content
-- MySite
---- de
------ Produkte
---- en
------ Products
Because of I used a empty page "MySite" for organizational purposes (if there are additional sites in future), I have the problem that if I go to the root domain without directory, I get an empty page (= the MySite page). How can I point to the de Homepage by default without doing a manual redirect?
I've tried to add the hostname www.mysite.com to the de page, but then the culture/language is ALWAYS set to german (so It overrides language for en pages). How to solve that?
Kind Regards,
Andreas
Add an umbracoInternalRedirectId property of type contentPicker to your MySite page document type and have it set to the /de page, so it will redirect to that page upon entering the www.mysite.com
(http://our.umbraco.org/wiki/reference/umbraco-best-practices/umbracointernalredirectid)
Add hostnames (may be dummy ones, as long as the culture is ok) to the /en and /de pages.
Cheers,
/Dirk
Dirk, thanks for the incredible fast and helpful reply! That's what I was looking for..
One more question according to this topic:
I have 2 search pages:
- /de/suche.aspx
- /en/search.aspx
I have a form in the Master Page template which should post to the specific search page. Is it right to store the search page path as Dictionary entry to set the form action dynamically?
Ok, 3rd try before I break this forum again....
you could use dictionary items, but wouldn't recommend that in case someone changes the name of the page.. which would make the url turn into a 404...
Add an extra property on the 'en' and 'de' page (content picker) and use it to retrieve the page from xslt or from within your template (depending on how you're building up the form)
Cheers,
/Dirk
Alright, but then I get back the page ID instead of the right (absolute) url.
<form id="searchform" method="post" action=''>
<input value="Search" id="search" />
form>
If the form is shown on
www.mysite.com/en/solutions/dms.aspx
The form action will go to
www.mysite.com/en/solutions/1234.aspx (not working) instead of
www.mysite.com/en/search.aspx
How to get that (current language sub directory & nice page name) using a page field in a template? Do I need a XSLT macro to convert the page template to the right URL format? (1234 -> /en/search.aspx)
Yup, a content picker only has the id of the node, there's a couple of ways to get it from your template:
or using the inline xslt syntax as outlined here
Hope this helps.
Regards,
/Dirk
Pretty cool, thank you!
Hello,
using umbracoInternalRedirectId for my root page mapping to the default language homepage (e.g. /de), this page is then accessible via the following TWO urls:
http://www.mysite.com/
http://www.mysite.com/de
So since its a transparent redirect (using umbracoInternalRedirectId), also search engines doesn't recognize this, which may be a disadvantage concerning SEO?!
What do you think? Would it be better to get REALLY and visibily redirected to /de (the default language) to avoid that there are 2 URLs which provide exactly the same contents? How do others handle that on their multilingual sites?
Best Regards
Andreas
is working on a reply...