Suppose we have an existing static web site with URLs of the form:
http;//www.example.com/science/*.html -- science-related pages
http://www.example.com/history/*.html -- history-related pages
http;//www.example.com/politics/*.html -- politics-related pages
The URL of a page tells you at a glance which section of the web site you are in.
Now suppose we migrate this to MODx operating in search-engine-friendly mode.
It appears that MODx has no ability to preserve the subdirectory name in the URLs. If we didn’t want to set up mod_rewrite maps for each subdirectory, we would need to change all the nice old URLs into a flat namespace, something like this;
http;//www.example.com/science-*.html -- science-related pages
http://www.example.com/history-*.html -- history-related pages
Although we can still identify the section from the name of the URL, the old intuitive concept of URLs being inside a directory or folder based on the subject is now missing. And there is something not so friendly about URLs changing, from the point of view of the user.
Am I overlooking something? Is there in fact a feature in MODx that will let it support a hierarchical namespac? I tried setting up aliases and MODx silently stripped out the slashes from the alias names.
While mod_rewrite might let us preserve the old namespace, it seems to be an inelegant way of doing it. If each access to a web page ultimately results in just a database query, shouldn’t MODx’ aliases allow embedded slashes?