I've got a website in 2 languages, but both languages have their own url. For exameple I have:
- test.nl - test.co.uk
The problem is that if I go to test.nl/co-uk I can also visit the other language, because that's simply a node in the website. The same goes for test.co.uk/nl. Can I do some url rewritting that if I'm on test.nl and I try to go to test.nl/co-uk it get's redirected to test.nl again and the same if I'm on test.co.uk of course. Any idea what's the best solution?
Url rewrite for multi-language websites
Hello,
I've got a website in 2 languages, but both languages have their own url. For exameple I have:
- test.nl
- test.co.uk
The problem is that if I go to test.nl/co-uk I can also visit the other language, because that's simply a node in the website. The same goes for test.co.uk/nl. Can I do some url rewritting that if I'm on test.nl and I try to go to test.nl/co-uk it get's redirected to test.nl again and the same if I'm on test.co.uk of course. Any idea what's the best solution?
Jeroen
Jeroen,
set umbracoHideTopLevelNodeFromPath in the web.config to true.
Then put the hostnames in umbraco BO on the test.nl and test.co.uk nodes (with their correct language which you should have defined)
Rgds,
David#
Hi David,
I've already done that. The problem is my languages aren't the top nodes. There is a node above it with some site settings. So my structure is:
-Website
--language1
--language2
On language1 and language2 I've set the host names, but I can still go to the other language.
Jeroen
You need to set useDomainPrefixes to true in the /config/umbracoSettings.config.
What does useDomainPrefixes do?
Jeroen
Jeroen,
You can use the rewriting like this, add these lines to the UrlRewriting.config in the config folder
and the opposite rewriting for the other domain
I hope this is the solution for your setup.
Rgds,
David#
this will ensure that urls are unique when running with multiple root nodes
is working on a reply...