asp.net - Using custom virtual paths -


i'm making test solution 2 or 3 pages organized in folders this:

enter image description here

and when run app url this:

enter image description here

there way maintain physical path having different virtual path

http://localhost:40300/index.aspx 

without odd word "views"?

take @ url rewrite module iis. alternative, can create custom http module rewrite virtual path appropriately:

public class myrewritehttpmodule : ihttpmodule {   // ...    public void init(httpapplication app)   {     app.authenticaterequest += application_authenticaterequest;   }    private void application_authenticaterequest(object sender, eventargs e)   {     var app = sender httpapplication;     var path = app.request.url.pathandquery;      if (!path.startswith("/views/", stringcomparison.ordinalignorecase))       app.context.rewritepath("/views/" + path);   } } 

Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -