My query is exactly the same as Rewrite AngularJS URL , but I am using IIS as my web server.
How do I fix the URL? Currently my URL looks like
http://example.com/app#/
which needs to be changed like
http://example.com/app/#/
My query is exactly the same as Rewrite AngularJS URL , but I am using IIS as my web server.
How do I fix the URL? Currently my URL looks like
http://example.com/app#/
which needs to be changed like
http://example.com/app/#/
In case we are using ASP.NET MVC runtime to trigger Index
action on the HomeController
to act as "index.html" (returning the view index.cshtml
) - we can just add these lines into it:
public ActionResult Index()
{
var root = VirtualPathUtility.ToAbsolute("~/");
var applicationPath = Request.ApplicationPath;
var path = Request.Path;
var hasTraillingSlash =
root.Equals(applicationPath, StringComparison.InvariantCultureIgnoreCase)
|| !applicationPath.Equals(path, StringComparison.InvariantCultureIgnoreCase);
if (!hasTraillingSlash)
{
return Redirect(root + "#");
}
return View();
}
Check this Browser address will not be displayed correctly in ui-route