URLs with a dot generate a server error 404 (e.g. www.mysite.com/a.b). A solution is editing my site's HTTP handlers, with a new handler that looks for a specific path criteria. If the request matches it is correctly sent to .NET for processing. The handler is shown below.
<add name="ApiURIs-ISAPI-Integrated-4.0"
path="*"
verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS"
type="System.Web.Handlers.TransferRequestHandler"
preCondition="integratedMode,runtimeVersionv4.0" />
Because im using path="*", all static files like .css or .js fail and get blocked. My static files are in a /Content directory. Is there a way to exclude the directory from this?
Try to add the below web.config file in the directory from where you want to remove the handler:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<remove name="ApiURIs-ISAPI-Integrated-4.0" />
</handlers>
</system.webServer>
</configuration>
Refresh the site after doing changes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With