We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27384
    • 12 Posts
    Hi,

    I am currently running MODx Revolution 2.0.0-pl rev7212 and have activated friendly URL’s. I have noticed that there are two ways to navigate to a site page

    http://www.mysite.co.uk/info/privacy-policy.html
    http://www.mysite.co.uk/6

    Where 6 is the resource ID.

    Is there any way to stop people navigating to a page by typing in http://www.mysite.co.uk/6 ?
      • 26016
      • 561 Posts
      Hi,
      If it were me, that wouldn’t bother my in the least. However, I can give you an idea.... you may be sorry you asked if you’re not geekie. smiley

      System... System Settings...

      In the "filter by area" dropdown choose Friendly URL.

      There are two settings in there, FURL Alias Character Restriction Method, and FURL Alias Character Restriction Pattern.

      The first one chooses a method. Mine is set to Regex, which I can do when I need to, but it’s very geekie, so for me, error-prone. I was going to say you could try "alpha" there. But I don’t know if it will work with the dash in your URL. It doesn’t tell you (grrr!!) but you can double-click the setting on the right to change it.

      I just tried "alpha" in the setting, and my URL with the dash still worked! BUT... the doc still came up when I used the number even after the usual Clear Cache that Revo seems to always always need. So to me that doesn’t work as advertised. Maybe an ubergeek will chime in with the other magic settings needed to make it work.

      So you have some stuff to experiment with. Be careful - if your site is live, you may want to test this on a non-live site.

      This could also be achieved with .htaccess changes, but again, very geekie.

      Cheers, Dave

        MODx and Wordpress development
        Linux, PHP 5.2, MySQL 5.0, Evo 1.05, Revo 2.08-pl, Firefox 4
        • 27384
        • 12 Posts
        Quote from: samba at Feb 10, 2011, 10:25 AM

        Hi,
        If it were me, that wouldn’t bother my in the least. However, I can give you an idea.... you may be sorry you asked if you’re not geekie. smiley


        Thanks for your reply I was thinking that the solution may entail some .htaccess trickery which is defiantly beyond me . If anyone knows a setting that can be tweaked I would be very happy.
          • 26016
          • 561 Posts
          Beyond .htaccess and the regex approach above, I doubt you’ll get any joy. Someone may prove me wrong.

          My recommendation... relax and say "who cares if some weirdo types in a number".

          If it’s secret pages you’re worried about, you can play with document access permissions.
            MODx and Wordpress development
            Linux, PHP 5.2, MySQL 5.0, Evo 1.05, Revo 2.08-pl, Firefox 4