c# - kestrel use folder path in all urls -


how set setup url subfolder localhost:5000/rootfolder/controller i.e. localhost:5000/mysite/home

   var host = new webhostbuilder()         .usekestrel()         .usecontentroot(directory.getcurrentdirectory())         .useiisintegration()         .usestartup<startup>()         .build(); 

if want make application available @ /site, can use application path base teach application can run path base prefix well.

just call usepathbase @ beginning of startup’s configure method:

public void configure(iapplicationbuilder app) {     app.usepathbase("/site");      // …     app.usemvc(); } 

by doing that, if open site @ /site, work if opened without it, , generated links include path.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -