NullReferenceException on all pages except home page


I have an EPiServer 7.5 site set up on a client server and a local version on my laptop. I recently upgraded to a new laptop and set up the site again, but this time I'm getting a NullReferenceException on all pages except the home page. Here's the stack trace:

[NullReferenceException: Object reference not set to an instance of an object.]
   EPiServer.Web.PageExtensions.SiteRedirect.SiteRedirect_PreLoad(Object sender, EventArgs e) +443
   System.EventHandler.Invoke(Object sender, EventArgs e) +0
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2981

It seems related to the friendly URL, because I do not get the error on the home page or when accessing the templates directly.

Jul 17, 2014 19:51

Hi Thomas,

Could be related to what sites you have defined in admin mode and what those sites site url is and what hosts they have.

Check that the url in your IIS site matches what you have there in admin mode (admin/config tab->site information).


Jul 18, 2014 0:18

Thanks, Toni, but I only have one site defined, and it matches the one in IIS. I tried adding a second host name, but it had the same problem: all pages referenced through a friendly URL show the NullReferenceError above.

Jul 21, 2014 15:30


did you find a soultion to the error ?

i"m keep getting this error sometimes

Dec 10, 2014 13:41

I ended up doing a reinstall, and fortunately, the problem didn't resurface. I'm still not sure what the cause was.

Dec 10, 2014 14:30

i managed to understand the problem and fix it.

i added * to the site with the language i"m using 

the first is with ar

the second * with ar

Dec 10, 2014 17:20
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.