This works perfectly. But in my template all links are still with an trailing slash
So I found the requesthandlersettings and added
"RequestHandler": {
"AddTrailingSlash": false
}
to my appsettings.json. Now every link has no trailing slash.
So far everything is working perfectly. But only locally in my test environment – when I upload the appsettings.json to production I get a 500 server error.
Can anyone point me in the right direction, and give me clue about whats wrong?
No Trailing slashes gives server error
Hi! When trying to ensure that all my urls are without trailing slashs, I get a server error?
Here is what I have done.
I have added this to my web.config
<rule name="RedirectTrailingSlash" stopProcessing="true"> <match url="(.*?)/+$" /> <conditions> <add input="{REQUEST_METHOD}" pattern="^POST$" negate="true" /> <add input="{REQUEST_METHOD}" pattern="^PUT$" negate="true" /> <add input="{REQUEST_METHOD}" pattern="^DELETE$" negate="true" /> <add input="{REQUEST_METHOD}" pattern="^PATCH$" negate="true" /> <add input="{REQUEST_URI}" pattern="^/umbraco/" negate="true" /> <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>
This works perfectly. But in my template all links are still with an trailing slash So I found the requesthandlersettings and added
"RequestHandler": { "AddTrailingSlash": false }
to my appsettings.json. Now every link has no trailing slash.So far everything is working perfectly. But only locally in my test environment – when I upload the appsettings.json to production I get a 500 server error.
Can anyone point me in the right direction, and give me clue about whats wrong?
Hmm... I tried to move the RequestHandler in the appsettings.json and suddenly it works! I have no clue why.. but i'm happy.
is working on a reply...