Try our conversational search powered by Generative AI!

url rewriting and virtual path providers



We're using a custom made virtual path provider in order to be able to put our aspx and ascx's in a core library dll as embedded resources, thereby making it possible to use the same page type definitions on many different episerver sites by only importing the dll.

However, the urls to the core aspx files become quite ugly. The address bar might show something like http://localhost/virtual_path/CoreLibrary.dll/CoreLibrary.Pages.Templates.MyCorePage.aspx?id=1234. This is not a winner, and I'm trying to use some url rewriting to beautify these urls. However, when I'm using something like to accomplish this, I get exceptions of the following kind:

"The current template does not match the specified page type file"

Even though I verify that the page id is correct. Any ideas?

// Peter

***Using EPiServer 4.61 on the ASP.NET Development Server (not IIS)

May 14, 2008 11:08


There  is a setting in web.config called "pageValidateTemplate, does it work if you set this to false?

May 14, 2008 11:40

Hello Greger,

There seems to be no such setting in my web.config. Maybe it's only present in EPiServer 5?

May 14, 2008 13:30

Add this to you page-templates and try again.

public override void ValidatePageTemplate()


Regarding the pageValidateTemplate in web.config, I'm not sure if that key is added per default, but you can add it yourself.



May 14, 2008 13:52
That did the trick! Thanks a lot Erik and Greger.
May 14, 2008 16:52
* 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.