Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Am I being naive thinking that all I need to do is set the host names and add the following to umbracoSettings.config?
<errors> <error404> <errorPage culture="default">1141</errorPage> <errorPage culture="en-GB">3806</errorPage> <errorPage culture="de-DE">3806</errorPage> </error404></errors>
I've had success with
<error404> <errorPage domain="default">5432</errorPage> <errorPage domain="en.domain.com">5432</errorPage> <errorPage domain="de.domain.com">3831</errorPage></error404>
don't forget to also set
<requestHandler> <!-- this will ensure that urls are unique when running with multiple root nodes --> <useDomainPrefixes>true</useDomainPrefixes>
But saying that... I've not successfully got it to work not when using medium trust and <add key="umbracoUseDirectoryUrls" value="true" />
I had to add my own 404 handler to mimic what the inbuilt one should be doing...
public class FidusCMS404Redirect : INotFoundHandler { private int _redirectID = -1; #region INotFoundHandler Members public bool CacheUrl { get { return false; } } public bool Execute(string url) { if (umbraco.UmbracoSettings.UseDomainPrefixes) { // we have multiple domains, try and map 404's XmlNode error404Node = UmbracoSettings.GetKeyAsNode("/settings/content/errors/error404"); if (error404Node.ChildNodes.Count > 0 && error404Node.ChildNodes[0].HasChildNodes) { // try to get the 404 based on current domain XmlNode domainErrorNode; string CurrentDomain = System.Web.HttpContext.Current.Request.Url.Host.ToLower(); // try match to domain domainErrorNode = error404Node.SelectSingleNode(String.Format("errorPage [@domain = '{0}']", CurrentDomain)); try { _redirectID = int.Parse(domainErrorNode.FirstChild.Value); } catch { domainErrorNode = error404Node.SelectSingleNode(String.Format("errorPage [@domain = '{0}']", "default")); try { _redirectID = int.Parse(domainErrorNode.FirstChild.Value); } catch { _redirectID = Convert.ToInt32(UmbracoSettings.GetKey("/settings/content/errors/error404")); } } } else { _redirectID = Convert.ToInt32(UmbracoSettings.GetKey("/settings/content/errors/error404")); } }else{ _redirectID = Convert.ToInt32(umbraco.UmbracoSettings.GetKey("/settings/content/errors/error404")); } umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.NotFound, _redirectID, "404 Redirect - " + HttpContext.Current.Request.Url); //301 rather than just 404 //HttpContext.Current.Response.Status = "301 Moved Permanently"; //HttpContext.Current.Response.AddHeader("Location", umbraco.library.NiceUrl(_redirectID)); return true; } public int redirectID { get { //return 1983; return _redirectID; } } #endregion }
Forgot to add that the 404 custom implementation here, assumes only one primary domain for each root node (which is good seo anyways :-))
I have <add key="umbracoUseDirectoryUrls" value="true" />
and <useDomainPrefixes>false</useDomainPrefixes>
As i'm using 'fake' domains like /de/
Although i've set the culture on the home nodes...
no worries... I've not tried with the culture settings on the subdirectory approach for multilanguage.
Hey djscorch,
How did you finally manage to make it work ?
Thanks,
Nicolas.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Do the Multi Lingual 404 pages work in 4.7.1?
Am I being naive thinking that all I need to do is set the host names and add the following to umbracoSettings.config?
I've had success with
don't forget to also set
But saying that... I've not successfully got it to work not when using medium trust and <add key="umbracoUseDirectoryUrls" value="true" />
I had to add my own 404 handler to mimic what the inbuilt one should be doing...
Forgot to add that the 404 custom implementation here, assumes only one primary domain for each root node (which is good seo anyways :-))
I have <add key="umbracoUseDirectoryUrls" value="true" />
and <useDomainPrefixes>false</useDomainPrefixes>
As i'm using 'fake' domains like /de/
Although i've set the culture on the home nodes...
no worries... I've not tried with the culture settings on the subdirectory approach for multilanguage.
Hey djscorch,
How did you finally manage to make it work ?
Thanks,
Nicolas.
is working on a reply...