asp.net - Rewrite root url call to subfolder -


i have single page app index.html located in sub folder. people see when acess root url. what's missing in rewrite rule?

<rewrite>   <rules>     <rule name="spa rewrite">       <match url="http://app.local" />       <action type="rewrite" url="http://app.local/spa/dist" />     </rule>   </rules> </rewrite> 

your rule should this:

<rule name="spa rewrite" stopprocessing="true">   <match url=".*" />   <conditions logicalgrouping="matchall">       <add input="{http_host}" pattern="app.local" />       <add input="{request_filename}" matchtype="isfile" negate="true" />       <add input="{request_filename}" matchtype="isdirectory" negate="true" />   </conditions>   <action type="rewrite" url="/spa/dist" /> </rule> 

in answer, used incorrect patter in <match url= section. , spa not need rewrite files , directories


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -