asp.net - Trailing slash Umbraco and HTTPs -
i have umbraco site sits behind netscaler. requests translated http https (via netscaler) , trailing slash appended using iis rewrites. iis re-write rule causing https request (without trailing slash) insert additional request status of 302. essentially:
https://example.com/news (status 301)
http://example.com/news/ (status 302)
https://example.com/news/ (status 200)
ideally 1 301 redirect , 200 - need remove temporary redirect
the iis rewrite rule add trailing slashes:
<rule name="add trailing slash" stopprocessing="true"> <match url="(.*[^/])$" ignorecase="true" /> <conditions> <add input="{request_method}" pattern="post" negate="true" /> <add input="{request_filename}" matchtype="isfile" negate="true" /> <add input="{request_filename}" matchtype="isdirectory" negate="true" /> <add input="{request_uri}" pattern="^/umbraco/" negate="true" /> <add input="{url}" pattern="^.*\.(asp|aspx|axd|asmx|css|htc|js|jpg|jpeg|png|gif|mp3|ico|pdf|txt|htm|html|php|xml)$" negate="true" ignorecase="true" /> <add input="{url}" pattern="/base" negate="true" /> <add input="{url}" pattern="cdv=1" negate="true" /> </conditions> <action type="redirect" redirecttype="permanent" url="{r:1}/" /> </rule>
i have implemented in umbracosettings.config file
{addtrailingslash}true{/addtrailingslash}
i have tried rewrite rule
<rule name="http redirect https" enabled="true" patternsyntax="ecmascript" stopprocessing="true"> <match url="(.*)" /> <conditions logicalgrouping="matchall" trackallcaptures="false"> <add input="{https}" pattern="^off$" /> </conditions> <action type="redirect" url="https://{http_host}/{r:1}" /> </rule>
but causes infinite loop of 301's , page dies
running out of idea's
sorted it.
<action type="redirect" redirecttype="permanent" url="{r:1}/" />
is not enough though redirect permanent protocol standard port 80. action type need updated to:
<action type="redirect" url="https://{http_host}/{r:1}/" redirecttype="permanent" />
you need specify https complete host , {r:1}/ in url attribute
Comments
Post a Comment