url rewriting and virtual path providers

Vote:
 

Hello,

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 urlrewriting.net 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)

#19906
May 14, 2008 11:08
Vote:
 

Hi,

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

#19910
May 14, 2008 11:40
Vote:
 

Hello Greger,

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

#19913
May 14, 2008 13:30
Vote:
 

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.

 

 

#19915
May 14, 2008 13:52
Vote:
 
That did the trick! Thanks a lot Erik and Greger.
#19926
May 14, 2008 16:52