Copied to clipboard

Flag this post as spam?

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


  • Robert Valcourt 70 posts 103 karma points
    Oct 27, 2011 @ 05:55
    Robert Valcourt
    0

    Umbraco directory URLs without the .aspx

    Hello,

    My client is updating their old Umbraco 3 site to Umbraco 4.71. On their old site, all pages had .aspx as the extension. On the new site they want to use friendly directory URLs with the trailing slash. I have this all set up and it works fine. My question is regarding the .aspx extension when uysing directory URLs...

    URL of the OLD site contact page: www.domain.com/contact.aspx

    URL of the NEW site contact page: www.domain.com/contact/

    Umbraco seems to still allow the .aspx extension on the new site, even though directory URLs is turned on. This means that if I type in my browser www.domain.com/contact.aspx on the NEW site, the page still loads, and retains the .aspx extension. I need umbraco to not allow the .aspx extension and throw a 404 status.

    I already have programming developed where I can specify all the old .aspx URLs, and when detected, will forward the request to the new friendly URLs using a 301 status. But this programming doesn't kick in unless a 404 status is triggered.

    Bottom line... I need Umbraco to trigger a 404 status on all URLs that contain the .aspx extension. Possible?

  • Richard Soeteman 4035 posts 12842 karma points MVP
    Oct 27, 2011 @ 08:32
    Richard Soeteman
    0

    Hi Robert,

    From what I'm reading you want a 301 redirect. This can be done using a simple urlrewite configuration. Check out this blogpost that does this and and a lot more for SEO imporovement

    Hope this helps you,

    Richard

  • Rodion Novoselov 694 posts 859 karma points
    Oct 27, 2011 @ 15:28
    Rodion Novoselov
    0

    Hi. If you want to do this just for SEO purposes then perhaps a more modern way to resolve the duplicate content issue would be using meta canonical tag in the page header. You can use an existing component for it (search the project section of this site).

    If on the other hand you really want to give 404 for any .aspx-ended request you could set up a URL rewriting rule for it in IIS URL rewriting module or UrlRewritingNet - whichever you prefer.

Please Sign in or register to post replies

Write your reply to:

Draft