I have a site with multiple languages organized as follows: Multiple top level nodes, each with Domain (under Culture and Hostnames) set to www.mydomain.com/lang, where "lang" is the two-letter language code. One of them is English i.e. www.mydomain.com/en.
Now my situation is that the site responds to both www.mydomain.com/somepage and www.mydomain.com/en/somepage. This is fine, but what is not so good is that it leaves the URL in the request as is, which results in the same content rendered from two different URLs. Which is not good for SEO.
I'm not exactly sure how it became like this, but what I'd like to do now is to redirect all root domain requests (with subpaths) to one with the /en subpath. I.e. www.mydomain.com/somepage -> www.mydomain.com/en/somepage.
The other solution, which was my first thought, is to use the root domain only for English, and remove /en from the Domain setting. But, Google has indexed a lot of my pages using the /en subpath, so all these links will then end up in a "Page not found". I know that using the root domain only for English could be better for SEO, but how can I then get a general redirect from the /en requests to root domain requests and have Google update its indexing?
Ok, so I figured it out myself. Maybe it is straightforward for experienced 301 URL Tracker users, but I must admit that I was expecting a little more documentation and maybe some examples for it. Anyway, in case anyone else is fumbling with this:
Redirect from root domain to language subfolder
I have a site with multiple languages organized as follows: Multiple top level nodes, each with Domain (under Culture and Hostnames) set to www.mydomain.com/lang, where "lang" is the two-letter language code. One of them is English i.e. www.mydomain.com/en.
Now my situation is that the site responds to both www.mydomain.com/somepage and www.mydomain.com/en/somepage. This is fine, but what is not so good is that it leaves the URL in the request as is, which results in the same content rendered from two different URLs. Which is not good for SEO.
I'm not exactly sure how it became like this, but what I'd like to do now is to redirect all root domain requests (with subpaths) to one with the /en subpath. I.e. www.mydomain.com/somepage -> www.mydomain.com/en/somepage.
The other solution, which was my first thought, is to use the root domain only for English, and remove /en from the Domain setting. But, Google has indexed a lot of my pages using the /en subpath, so all these links will then end up in a "Page not found". I know that using the root domain only for English could be better for SEO, but how can I then get a general redirect from the /en requests to root domain requests and have Google update its indexing?
Any ideas and advice will be much appreciated!
Hi Bendik,
As I know you just need to create 301 redirect to new location -it's enough for Google reindexing.
Try to use 301 URL Tracker - https://our.umbraco.org/projects/developer-tools/301-url-tracker/
You can use Regex redirect for all urls to without /en I think.
Thanks,
Alex
Thanks Alex!
I think this must be the way to go:-) But my RegEx is just terrible, could you help me out on that?
Ok, so I figured it out myself. Maybe it is straightforward for experienced 301 URL Tracker users, but I must admit that I was expecting a little more documentation and maybe some examples for it. Anyway, in case anyone else is fumbling with this:
Root node: /
Regex: ^en\/(.*)
Redirect URL: $1
Hi Bendik,
Thanks for sharing! Nice job.
Glad that topic is solved.
Have a nice day!
/Alex
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.