Copied to clipboard

Flag this post as spam?

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


  • John French 32 posts 83 karma points
    Dec 06, 2012 @ 03:36
    John French
    0

    Going to a page via a mastepage

    Hello,

     

    How do I turn off the functionality to allow a user to isit a page by typing in the url of the masterpage

    For example I have a template called UserDetails.  A user can go to this page by tying in http://www.mysite.com/UserDetails. ; But I don't want them to... How do I turn this off?

    Thanks

    James

  • Mike Chambers 636 posts 1253 karma points c-trib
    Dec 07, 2012 @ 11:36
    Mike Chambers
    0

    You could use the url rewriting engine to redirect/rewrite to the real page rather than turn off the alttemplate support?

     

    either rewerite rule for ^.*/UserDetails ... 

     

    <addname="UserDetails" 
    virtualUrl="~(.*)?/UserDetails"
    rewriteUrlParameter="ExcludeFromClientQueryString"
    destinationUrl="~$1?"
    ignoreCase="true"/>

    or

    depending on how this actually works behind the scenes you could rewirte for any page request that ends up as page?altTemplate=XXX

    not checked if  http://www.mysite.com/UserDetails acually routes to  http://www.mysite.com/?altTemplate=UserDetails

  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    Dec 07, 2012 @ 12:14
    Tim
    1

    If you want to turn off the alternate URL feature altogether, I think you can do it by going into the 404handlers.config file in the site "/config" folder and commenting out the entry 

    <notFound assembly="umbraco" type="SearchForTemplate"/>

    You may need to touch the web.config for the setting to take effect.

  • John French 32 posts 83 karma points
    Mar 12, 2013 @ 10:00
    John French
    0

    Yes that worked!

     thanks tim

Please Sign in or register to post replies

Write your reply to:

Draft