For 2 root nodes, how can a 404 be returned for pages that don't exist?
I have two root nodes, with different hostnames, assume en.web.com is the first and gr.web.com is the second, and each is a different language.
However I have a page, en.web.com/test.aspx that can only exist in one language, and not in the second. So I have not copied this node to the second root.
How can I make umbraco return a 404 if gr.web.com/test.aspx is requested? Right now it returns the page of the first root, but this is not what I want.
I'm sorry as probably I did not write this clear enough. I don't mean custom 404's. What I mean is:
1) User requests:en.web.com/test.aspx >>> Umbraco returns the node "test" under the root of en.web.com
2) User requests:gr.web.com/test.aspx >>> Umbraco returns the node "test" *again* of the root en.web.com because test does not exist under the gr.web.com root node.
Note that I have "umbracoHideTopLevelNodeFromPath" set to true.
But this is not what I want, as test.aspx does not and should not exist for the second language. I want instead a 404 not found error to be returned (I don't care in what language - this is completely different).
Indeed this does it. However I notice that when useDomainPrefixes is true, umbraco.library.NiceUrl seems to have a different behavior: It returns the hostname with the path (it starts with http://..../test.aspx ). If useDomainPrefixes is false, then it returns only an absolute path without the hostname (it starts with /test.aspx )
Is this normal? Shouldn't niceurl return the same information no matter what this setting is? I'm using 4.7.0.
You're right would be better if NiceUrl would only render absolute Url's if the nodeid is outside of the current host-name. But that might be a little complex.
For 2 root nodes, how can a 404 be returned for pages that don't exist?
I have two root nodes, with different hostnames, assume en.web.com is the first and gr.web.com is the second, and each is a different language.
However I have a page, en.web.com/test.aspx that can only exist in one language, and not in the second. So I have not copied this node to the second root.
How can I make umbraco return a 404 if gr.web.com/test.aspx is requested? Right now it returns the page of the first root, but this is not what I want.
I'm using 4.7.0.
Hi,
I believe you can set multi language 404's in /config/umbracoSettings.config under settings/content/errors.
Either that or you can write your own custom 404 handler like this - http://our.umbraco.org/wiki/how-tos/how-to-implement-your-own-404-handler
I'm sorry as probably I did not write this clear enough. I don't mean custom 404's. What I mean is:
1) User requests:en.web.com/test.aspx >>> Umbraco returns the node "test" under the root of en.web.com
2) User requests:gr.web.com/test.aspx >>> Umbraco returns the node "test" *again* of the root en.web.com because test does not exist under the gr.web.com root node.
Note that I have "umbracoHideTopLevelNodeFromPath" set to true.
But this is not what I want, as test.aspx does not and should not exist for the second language. I want instead a 404 not found error to be returned (I don't care in what language - this is completely different).
You need to set useDomainPrefixes to true in config/umbracoSettings.config
Indeed this does it. However I notice that when useDomainPrefixes is true, umbraco.library.NiceUrl seems to have a different behavior: It returns the hostname with the path (it starts with http://..../test.aspx ). If useDomainPrefixes is false, then it returns only an absolute path without the hostname (it starts with /test.aspx )
Is this normal? Shouldn't niceurl return the same information no matter what this setting is? I'm using 4.7.0.
http://our.umbraco.org/wiki/reference/umbracolibrary/niceurl
You're right would be better if NiceUrl would only render absolute Url's if the nodeid is outside of the current host-name. But that might be a little complex.
is working on a reply...