I want to make an url like http://localhost:1373/Explore/Neighborhood/WA/P.L.U.
Could you please help me out on this?
How to allow dots in url using regex constraint in attribute routing mvc5?
I want to make an url like http://localhost:1373/Explore/Neighborhood/WA/P.L.U.
Could you please help me out on this?
How to allow dots in url using regex constraint in attribute routing mvc5?
IIS looks at anything with a period as a file, So it will look for a file. as a work around try using IIS Rewrite to add the trailing slash to all URLs. With a trailing slash IIS will route it properly.
<rule name="Add trailing slash" stopProcessing="true">
<match url="(.*[^/])$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="{R:1}/" />
</rule>
Check out this link. http://ruslany.net/2009/04/10-url-rewriting-tips-and-tricks/#trailing-slash
Or in MVC you can add RouteTable.Routes.AppendTrailingSlash = true;