We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32963
    • 1,732 Posts
    Hello everyone,

    Jeff had suggested that we make alias names case-sensitive due to the following:

    "For instance, with Google Sitemaps, it’s necessary to have a verification file for Google to ensure it’s spidering the right site. This file usually takes the form of something like this: GOOGLE6e621822933bfbdf.html. As you can see, the ’GOOGLE’ part of this is uppercase and when I create a hidden document with that alias, it turns into this ’google6e621822933bfbdf’. Since calls to files with Apache are case sensitive, Google will get a 404 when trying to see the above page. So...might be good to make aliases case sensitive as well. smiley"

    How’s it possible for Apache to render a 404 page when the modx parser is case-insensitive and should be able to render ’GOOGLE6e621822933bfbdf’ as ’google6e621822933bfbdf’?




      xWisdom
      www.xwisdomhtml.com
      The fear of the Lord is the beginning of wisdom:
      MODx Co-Founder - Create and do more with less.
      • 4018
      • 1,131 Posts
      Apache is case-sensitive when it comes to the names of HTML pages. Currently, if you enter "GOOGLE6e621822933bfbdf" as an alias name, it actually comes out as "google6e621822933bfbdf" due to the fact that when the page is saved in MODx, the alias name is changed to all lower-case letters (using the strtolower function). As such, whenever you attempt to browse for a page called "GOOGLE6e621822933bfbdf.html", the result is a 404 "Page not found" error since Apache believes the page doesn’t exist. I found this out while attempting to create a verification page for Google. Google won’t see the page if the "GOOGLE" part of the name is lower-case...thus it has to be upper-case in order for Google to see it.

      It’s really just a matter of removing the strtolower function from the stripAlias function in save_content.processor.php and using the strtolower directly on the alias name only when needed. When a page is saved to the database, the check for duplicate aliases will still work because MySQL is case-insensitive when comparing values in the database. So a check for an alias called "ThisPage" will still match up to one called "thisPage" or "thispage". However, we’ll probably need to revisit it later on if we add support for other databases other than MySQL. But for now, this should do just fine. smiley
        Jeff Whitfield

        "I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."
        • 25663 MODX Staff
        • 12,272 Posts
        I think it’s a good idea, and a very good one at that, to be nice to Google Sitemaps.
          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • 13577
          • 302 Posts
          I’ll play devils advocate, as I was a major proponent in getting RID of case sensitivity in Etomite alias’. I’m not sure how many folks out there are doing the Google site map stuff. I’ve never done it myself actually. Not that I’m a shining example obviously. But what was killing me was the fact that to make some URLs easier to read, such as: JaredCarlow.htm - caps are convenient. But there’s no way I expect people to use anything but lowercase. For instance, we use FirstnameLastname.htm for our faculty profiles. But I wouldn’t want to force people to type it in case sensitively.
            Standard Disclaimer
            I could be totally wrong.
            • 22303 MODX Staff
            • 10,725 Posts
            Not sure if this will work for Google Sitemaps, but here is what I do in my .htaccess rewrite rule, so that all aliases, regardless of case, can be found by MODx...

            RewriteRule ^(.*)$ index.php?q=$1 [L,QSA,NC]


            Notice the NC switch added to the standard MODx rewrite rule. This renders Apache case-insensitive in regards to MODx aliases.

            I too am totally against making aliases case sensitive for the same reasons Jared is, and because many sites I’ve converted from FrontPage would break all the existing links where. If we want to add an option to allow case-sensitive aliases however, I’d be fine with that. undecided