We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6016
    • 55 Posts
    crossconnect Reply #1, 17 years ago
    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?
    • You want to use the Use Friendly Alias Paths option and create containers (a.k.a. folders) for each section. The alias of each section will then be used to build a nested url path to the resources.
      • Initially I was confused about MODx’s ability to handle URL/subdirectories as well. But once you "get it", you never go back wink
          Mike Reid - www.pixelchutes.com
          MODx Ambassador / Contributor
          [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
          ________________________________
          Where every pixel matters.
          • 6016
          • 55 Posts
          crossconnect Reply #4, 17 years ago
          Thank-you. Containers seem to work nicely.

          Rahul