Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
There is better support for canonical url handling in version 8.* as described here http://thisisnothing.nystrom.co.nz/2015/02/12/improved-support-for-canonical-urls/
Hi Johan,
The article you mentioned is about the canoncal url meta tag instead of browser redirection.
In the meantime we have taken a different approach with the URL Rewrite module for IIS. The module also works in Azure Websites. This way we don't need the code solution and works fine.
To configure the module, we have included this in the web.config:
<system.webServer> <rewrite> <rules> <rule name="Default" patternSyntax="Wildcard" stopProcessing="true"> <match url="*" /> <action type="Redirect" url="http://www.host.com/{R:0}" /> <conditions> <add input="{HTTP_HOST}" pattern="www.host.nl" /> </conditions> </rule> </rules> </rewrite> </system.webServer>
During debugging we also found out that Global.UrlRewriteProvider is not very stable regarding determining the language based on url. The FriendlyUrlRewriteProvider does a better job at this.
The issue becomes visible when calling ConvertToInternal multiple times. As a result, the epslanguage parameter does not always have a value.
I hope this helps others having the same issues.
Hi,
For a multilingual and multidomain EPiServer 7.5 CMS website (version 7.19.2.0), I have an issue with resolving canonical URLs for content pages.
I would like to enforce that visitors to be redirected to the canonical URL of an EPiServer page.
To accomplice this I have an IInitializableHttpModule which is responsible for resolving the URL and redirecting the browser.
However, visitors do not always get redirected to the right URL.
Our setup:
[host].com/[url]/?[query] should HTTP 301 redirect to [host].com/en/[url]/?[query]
[host].be/[url]/?[query] should HTTP 301 redirect to [host].com/be/[url]/?[query]
[host].nl/[url]/?[query] should HTTP 301 redirect to [host].com/nl/[url]/?[query]
The issue:
In some cases when I request http://[host].nl/ I get redirected to http://[host].com/en/ instead of http://[host].com/nl/.
This seems to be caused by Global.UrlRewriteProvider.ConvertToExternal setting the language to English as instead of Dutch.
Does anyone have any clues on what can be done to fix this?