Copied to clipboard

Flag this post as spam?

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


  • Mike Taylor 155 posts 353 karma points
    Apr 29, 2014 @ 11:52
    Mike Taylor
    0

    How to disable /TemplateName altTemplate behaviour in v6?

    Hi

    OK, so if I browse to localhost/TemplateName, Umbraco treats this as localhost?altTemplate=TemplateName and renders the home page using the TemplateName template.

    I'm not using altTemplate in this particular site - is it possible to disable this behaviour?

    Thanks,

    Mike

  • Stephen 767 posts 2273 karma points c-trib
    Apr 29, 2014 @ 12:01
    Stephen
    101

    Umbraco natively support urls such as /foo/bar/template and renders page /foo/bar using the specified template. This is provided by the ContentFinderByNiceUrlAndTemplate content finder, which is at the moment not directly used but is substituted to the old legacy umbraco.SearchForTemplate "not found" handler.

    So assuming you haven't changed anything in the content finders setup, you just want to remove that legacy handler. This would be in ~/config/404handlers.config, where you need to remove the line that contains <notFound assembly="umbraco" type="SearchForTemplate" />.

    Let me know if it works
    Stephan

  • Mike Taylor 155 posts 353 karma points
    Apr 29, 2014 @ 12:12
    Mike Taylor
    0

    Hi Stephen - works perfectly. Thanks :)

Please Sign in or register to post replies

Write your reply to:

Draft