Have a Website build with ASP.NET MVC 3.
Publish it as below: create a virtual directory under website, copy MVC application to this folder and turn it to application. So the site structure looks like
Have UrlRewite as below so that http://www.example.com will be rewrite to http://www.example.com/travel without url changed.
<rule name="rewrite rule for home page" enabled="true" stopProcessing="false">
<match url="^$" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Rewrite" url="/home/index" appendQueryString="false" />
</rule>
<rule name="rewrite rule for virtual path" enabled="true">
<match url="^[\w-/\.]+$" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Rewrite" url="/travel/{R:0}" appendQueryString="false" />
</rule>
Then My problem came out.
script src="@Url.Content("~/Content/Js/Index.js")" type="text/javascript">
Url.RouteUrl("Lvxingshe")
Url.RouteUrl("ListOfCity", new { locationname = "LA" })
script src="@Url.Content("/Content/Js/Index.js")" type="text/javascript">
I have codes above in my home/index view. And they threw exceptions:
Cannot use a leading .. to exit above the top directory.