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.

"
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’?
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.
Jeff Whitfield
"I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."
-
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
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.