Copied to clipboard

Flag this post as spam?

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


  • Frederik T 242 posts 373 karma points
    Jan 12, 2012 @ 13:19
    Frederik T
    0

    Removing aspx from niceurl generated links

    hopefully this is a quick solution:

    I am using urlrewriting to to redirect .aspx links/urls to sites without the extension.

    but the problem is that all urls generated by niceurl (and locallink for that matter) all have the .aspx extension.

    I know of using "replace" to find and replace ".aspx" with "nothing" so to speak (which works) but that is quite the task to replace EVERY niceurl in every xslt file and i am sure there is an easier solution because i dont think im the only one who had this problem before.

  • awm 187 posts 376 karma points
    Jan 12, 2012 @ 13:27
    awm
    1

    Setting 'umbracoUseDirectoryUrls' to 'true' in the web.config should sort that out? Or does that not work for local links?

  • Frederik T 242 posts 373 karma points
    Jan 12, 2012 @ 13:39
    Frederik T
    0

    oh how stupid i feel now... i was 100% certain i had already done that and believed it didnt work. Well thank you for pointing me in the right direction, i feel a bit silly now.

    One last question: The urls have a trailing slash, is it possible to remove them as well? (my urlrewriting rule removes trailing slash and .aspx)

  • awm 187 posts 376 karma points
    Jan 12, 2012 @ 13:45
    awm
    0

    No worries :-)

    As for the slash I've also wondered the same.. I'm not sure how to do it myself though.

  • Frederik T 242 posts 373 karma points
    Jan 12, 2012 @ 14:04
    Frederik T
    0

    Well there is this in umbracoSettings.config:

    <!-- this will add a trailing slash (/) to urls when in directory url mode -->
    <addTrailingSlash>false</addTrailingSlash>


    which, WOULD seem like is the final solution i need but it looks like it does nothing. (note it was set to true before i modified it to what it is above)

  • awm 187 posts 376 karma points
    Jan 12, 2012 @ 14:09
    awm
    1

    Maybe you need to restart the site?

  • Frederik T 242 posts 373 karma points
    Jan 12, 2012 @ 14:19
    Frederik T
    0

    yup that worked :) thanks for the help

Please Sign in or register to post replies

Write your reply to:

Draft