we have multilingual (FR / EN ) website .the issue is if we test with others language in URL like www/mydomain.com/dE empty site will disply our requirement is to redirect to error page in case if langue not configured or content version is 0 .
1 Answer
You can simply add below code in your layout which will check if the context language is other then FR & EN and will redirect on the Error page.
@{
string lang = Sitecore.Context.Language.ToString();
if(!lang.Contains("en") && !lang.Contains(""fr))
{
Response.Redirect("Your error page URL");
}
}
Hope this helps.