Try our conversational search powered by Generative AI!

EPiServer 7 + Commerce 1R3 Single Language Issue


Hi All,


I'm wondering if someone can help me out. I'm on a project using EPiServer 7 + Commerce 1R3. The client will only be using a single language (en-AU). So I'm trying to remove the language code from the URL's. I have spent a lot of time trying to do this with no luck. I've even tried to get it to work using the Enoteca sample website. These are the things I have tried so far:

  • Disable the "Enable Globalization" flag
  • Directly applying the culture in Site Information (Results in a "Something Went Wrong" message the next time I enter edit mode. This also happened on the Enoteca site)


I have also tried disabling all languages in "Manage Website Languages" except for "en-AU". But this also results in a "Something Went Wrong" message. I'm not too sure whether this is because when you install a default instance of CMS + Commerce it installs some content under the "en" language code (i.e. root, recycle bin etc.). The commerce content provider is inserted under the "en-US" language code. Then when I start building my site I'm building it in the "en-AU" language code. So it seems like I need all three languages enabled.


If anyone knows how to solve this it would be greatly appreciated!


Thanks in advance



Aug 02, 2013 4:07

Can't recall currently what excaly was needed but there is stuff under en-US culture that is necessary for Commerce to work properly. I can take a deeper look a bit later.

Aug 02, 2013 9:37

I'm seeing two different parts in this:

(1) Switching the default language to en-AU (or another language). Admittedly, I have not tried this yet, but there's nothing that stands out to me that should initially cause any issues with this. You just need to make sure the default language in Commerce Manager is configured to be en-AU.

(2) Removing the language code from the URL. This is done by adding the language to the host name in EPiServerFramework.config (or applying the culture in Admin Mode -> Site Information). We've recently seen an issue with this (yesterday, actually), but this could just be related to our particular solution. We are currently looking into this issue.

I think the issues you are running into, specifically when testing on Enoteca, are because everything was built in the en-US language branch from the beginning. It's possible if you create a new solution from scratch, and focus on working only in the en-AU language branch, you might not have as many issues.

In EPiServer 7, from what I'm seeing, the default language branch of "en" for the Root Page and the Recycle Bin doesn't really matter too much. It's all dependent on what language branch you create the Start Page under.

Lastly, if all else fails, I'm sure there's a SQL script that can be ran to solve this. But I'd say that should be last ditch effort. 

Aug 02, 2013 15:52

I thought I'd just add some more information about the issue we're experiencing that Chris mentioned, because it sounds like part of the issue for you is the same as we're experiencing.

When setting the default language on the site to get rid of the language code we can't use the URL resolver to fetch a friendly url for the startpage. So we get the exception below whenever
the page we're trying to get the virtual path for is the startpage on the site. Since edit mode also tries to resolve the startpage url rendering the site tree and whatnot It also breaks down.

Tested this before and after switching master language branches, since the site where I'm having the issue is using en-US. Same result

The error we get is the following:

[NullReferenceException: Object reference not set to an instance of an object.]
EPiServer.Business.Commerce.Providers.CatalogEntryPageRoute.OnVirtualPathCreated(Object sender, UrlBuilderEventArgs e) +66
EPiServer.Web.Routing.ContentRoute.GetVirtualPath(RequestContext requestContext, RouteValueDictionary values) +442
EPiServer.Web.Routing.UrlResolver.GetVirtualPath(ContentReference contentLink, String language, RouteValueDictionary routeValues, RequestContext requestContext) +504
EPiServer.Web.Routing.UrlResolver.GetVirtualPath(ContentReference contentLink, String language) +25

From what I've gathered so far when the event VirtualPathCreated is triggered, the UrlBuilder object sent in is null or the Path property is because we get
a null exception in CatalogEntryPageRoute.OnVirtualPathCreated. With being able to properly debug the code executed in EPiServer.Business.Commerce.Proivders.CatalogEntryPageRoute and
stepping through the events leading up to that it's hard to say exactly what's wrong. All other pages load the their resolved url's fine, the only thing I can think of is that since the
startpage won't have any url segments the UrlBuilder object don't have the path set. The CMS handles this but the addon code for commerce don't have a null check for it.

Edited, Aug 02, 2013 20:55

Thanks for all the help guys!

Chris regarding the two parts you mentioned. I have no issue with the first point. We have successfully setup a site in en-AU and have it all working correctly with Commerce in en-AU also. It is the second point you mentioned where my problem lies. I've actually setup a site from scratch where all it has is the start page and one other content page. When I fire up the start page I am experiencing the exact error that Jonas described above. This error occurs after you set the language code by going to Admin -> Site Information. What I have noticed is that this error does not occur when you're running just the CMS. It is only when you apply commerce that these strange errors start to appear.

Jonas have you managed to find a way around this? I've been advised to log a support ticket for this issue so will keep you all updated.



Aug 04, 2013 2:54

Tinkered around a bit but did'nt find a way around the issue. And since the particular event is bound in the init module present in we can't opt out of it either. I've filed a support case with EPi regarding this.


Aug 04, 2013 8:19

It is the mismatch culture issue between ECF and CMS. Commerce 1 R3 does not support non-specific culture.

The same issues like:


Aug 06, 2013 4:53

Hi All,

I logged a support case for this and there is a hot fix available that fixes the issue. Basically you'll get an updated version of EPiServer.Business.Commerce.dll. Once I replaced the dll in my site everything worked fine. Just contact support to get the hot fix.



Aug 07, 2013 1:32

Regarding the NullReferenceException in OnVirtualPathCreated, the problem is that they forgot to check if the output from their RemoveTrailingSlash function returns null. This is the solution I came up with.

Create a local CatalogEntryPageRoute class that inherits from EPi's class, the only difference is that we check the var text for null:

public class CatalogEntryPageRoute : EPiServer.Business.Commerce.Providers.CatalogEntryPageRoute
		public CatalogEntryPageRoute(string url, string physicalFile) : base(url, physicalFile)
		public override void OnVirtualPathCreated(object sender, UrlBuilderEventArgs e)
			string text = VirtualPathUtility.RemoveTrailingSlash(e.UrlBuilder.Path);
			if (! string.IsNullOrWhiteSpace(text) && text.EndsWith(".aspx"))
				e.UrlBuilder.Path = text;
				Global.UrlRewriteProvider.ConvertToExternal(e.UrlBuilder, null, System.Text.Encoding.UTF8);


Create an intialization module, and hook up the above route class to the default route instead of EPi's:

public class MyDataInitialization : IConfigurableModule
	public void Initialize(InitializationEngine context)
		var entryViewUrl = UrlService.GetUrl(Constants.EntryViewCommandName);
		var defaultRoute = new CatalogEntryPageRoute("{seourl}.aspx", entryViewUrl);

		foreach (Delegate d in ContentRoute.CreatedVirtualPath.GetInvocationList())
			ContentRoute.CreatedVirtualPath -= (EventHandler<UrlBuilderEventArgs>)d;
		ContentRoute.CreatedVirtualPath = (EventHandler<UrlBuilderEventArgs>)Delegate.Combine(ContentRoute.CreatedVirtualPath, new EventHandler<UrlBuilderEventArgs>(defaultRoute.OnVirtualPathCreated));





Aug 16, 2013 16:17

Hi Mattias,

Thanks for posting through that solution. Good to know there is a way around it instead of the hot fix. I need to look into the initialization module a bit more as it seems we can do a lot with it.




Aug 29, 2013 3:39

Hi ,

I have question regarding , once we have stored products in our commerce and now my question is how we can display these products on my public website .? 

Please help me my email id is :


Sep 20, 2013 15:48

hi ,

How can we set our start page as our Customize page rather than default one page of Episerver .?




Sep 20, 2013 15:49

@paragi... Please refer to the Enoteca and Alloy demo sites. Furthermore, your posts are not relevant to this thread. If you are still having troubles after looking into the code from the demo sites, please post them in a new thread.

Sep 20, 2013 17:43

Migrating yet another site from CMS 6 -> 7 -> 7.5 and once again using Mattias Bomelin solution while in 7.0, thanks!

Jul 02, 2014 14:33
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.