Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jonas Nilsson 137 posts 260 karma points
    May 22, 2012 @ 20:30
    Jonas Nilsson
    0

    UrlRewriting and force trailing slash

    Is it possible to configure Umbraco with the UrlRewriting.config to force a trailing slash on the url, and leave non page url's like images, documents?

    Have only found an configuration for removing the trailing slash.

  • KO 3 posts 23 karma points
    May 22, 2012 @ 22:09
    KO
    0

    I am new to Umbraco so I am not sure if this will work or if there is a preferred method but you should be able to add the following to the web.config to test:

    <rewrite>
    <rules>
    <!-- Enforces Trailing Slashes for consistent URLs -->
    <rule name="AddTrailingSlashRule1" stopProcessing="true">
    <match url="(.*[^/])$"/>
    <conditions>
    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
    </conditions><action type="Redirect" url="{R:1}/"/>
    </rule>
    </rules>
    </rewrite>

    Good Luck

Please Sign in or register to post replies

Write your reply to:

Draft