Copied to clipboard

Flag this post as spam?

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


  • Inmedia 124 posts 176 karma points
    Jan 06, 2016 @ 14:16
    Inmedia
    0

    How to get URL's without .apsx extension?

    Can anyone tell me how I can add a rewrite to remove the .aspx extension from my URL's.

    I would like all my URLs to look like this:

    www.mysite.dk/page1

    instead of this:

    www.mysite.dk/page1.aspx

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Jan 06, 2016 @ 14:34
    Dave Woestenborghs
    0

    This can be turned off in the web.config file.

    Change the appSettting umbracoUseDirectoryUrls to true

    Dave

  • Inmedia 124 posts 176 karma points
    Jan 08, 2016 @ 17:26
    Inmedia
    0

    Hi Dave

    Yes, that partly solved the problem. The navigation is now pointing to the URL without the .aspx extension, but the URL with the extension is still accessible... I would like all the URLs with the .aspx extensions to automaticly redirect (301) to the URL without the extension, so I won't have any SEO problems with duplicate content.

    I think that is achieved in the URL rewrite config, but I just don't know what to ad in the config file.

    Maybe you know?

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Jan 09, 2016 @ 08:53
    Dave Woestenborghs
    1

    Hi Inmedia,

    I normally install this package. This will add some rewrite rules to your web.config. It solves the aspx issue as well if i'm correct

    https://www.nuget.org/packages/RedirectRules/

    Dave

  • Marc Goodson 2157 posts 14431 karma points MVP 9x c-trib
    Jan 09, 2016 @ 10:35
    Marc Goodson
    1

    Hi Inmedia

    Take a look at this 24days in Umbraco article about useful redirect rules for SEO in Umbraco:

    http://24days.in/umbraco/2014/redirect-rules/

    the following may match the aspx pages:

    <match url="^_*(.*)\.aspx$" />
    <action type="Redirect" url="_{R:1}" redirectType="Permanent" />
    
  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Jan 09, 2016 @ 11:34
    Dave Woestenborghs
    0

    Hey Marc,

    Nice...now I remember how I found this nuget package :-)

    Dave

  • Marc Goodson 2157 posts 14431 karma points MVP 9x c-trib
    Jan 09, 2016 @ 11:47
    Marc Goodson
    0

    Hi Dave

    Yes, sorry didn't refresh my browser before replying!, I have essentially repeated your answer... :-) hopefully article is a good read anyway.

Please Sign in or register to post replies

Write your reply to:

Draft