We've added a new language. We want missing pages to be redirected to the English equivalent. For example, if ~/zh/Services is missing, we want them redirected to ~/en/Services. Right now the user gets a 404 error.
We don't want to have to do this manually for every page. Is there some global setting we can use, or some code we can add?
Hm, no replies? So...is our only choice to manually instantiate zh versions of every page, and have each redirect to the existing en version?
sender, EventArgs e)
var ex = Server.GetLastError()
httpCode = ex.GetHttpCode();
(httpCode == 404)
Thanks, I'll try that!
EDIT: Not working yet.
I added the global.asax, added your code to the Application_Error handler, and rebuilt. I made one change, because I think a true 404 would otherwise cause an infinite loop:
.Context.Request.Url.Segments.Length - 1];
Is there another solution to this problem?
I do not like the "Application_Error" solution - I should not have to manually redirect to the English version of the page.
Furthermore, redirecting to the "en" version, will put Sitefinity in English mode. This causes problems if you are using a language-specific .resx file. For example, if a user requests "/fr/home" and I redirect them to "/en/home" it means that the English version of my .resx files will be chosen, which is not the desired result.
What i did was I created a Redirect Widget and put it inside the page. So this translated page will redirect to wherever i like.
Just a quick fix i can't find a solution to this right now. Any suggestion?