We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29935
    • 4 Posts
    I have a client that I am working with who desperately wants his URL structure to read index.php?page=pagealias instead of the index.php?id=pageid . Actually he wants it to read out area=pagealias. I’ve tried rewriting the .htaccess file, using the prefix in the friendly URL area, nothing seems to execute this request. I am sure it is pretty easy, but I am pretty new to all this ModX stuff. Thanks for any & all help in advance.
    -Brent
      • 3749
      • 24,544 Posts
      I think your client needs to have his or her head examined. wink

      But I think there are two easy ways to do it. With friendly URLs and friendly aliases on, you could just put the full alias in the alias field of the document (i.e. area=pagealias).

      Even easier, would be to go to tools | configuration | friendly URLs tab and, with friendly URLs and freindly aliases on, put ’area=’ in the friendly url prefix field.

      The default .htaccess should work unless the site is in a subdirectory.

      I’m assuming you really want "area=" for all of them instead of various area names. If you want that, it gets much more complicated.

      You can see some more details here:
      http://wiki.modxcms.com/index.php?title=Friendly_URLs_Guide

      or here if you want the print-friendly version:

      http://wiki.modxcms.com/index.php?title=Friendly_URLs_Guide&printable=yes
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 29935
        • 4 Posts
        Only thing is, it still has to have the "index.php?" part as well. Clients can be very picky but he seems to have his reasons. So basically I’d like to set it up so that each page is (example) mysite.com/index.php?area=news , mysite.com/index.php?area=about , mysite.com/index.php?area=contact etc... I am having trouble entering in the the index.php?area= prefix into the User Friendly configuration part of the modX manager, it just fails to direct me anywhere on test, simply refreshes the default page. It’s just important for him that the index.php? part is still part of the file extension, perhaps one day he’ll explain it to me why.
          • 7231
          • 4,205 Posts
          Just curious why you would rather have mysite.com/index.php?area=contact rather than simply mysite.com/contact ? With SEO friendly turned on you can simplify it. To do what you want I think you would need to edit/hack some core files or use some fancy mod_rewrite rules.
            [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

            Something is happening here, but you don't know what it is.
            Do you, Mr. Jones? - [bob dylan]
            • 20413
            • 2,877 Posts
              @hawproductions | http://mrhaw.com/

              Infograph: MODX Advanced Install in 7 steps:
              http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

              Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
              http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
              • 22303 MODX Staff
              • 10,725 Posts
              Quote from: TIBrent at Feb 14, 2009, 01:52 AM

              I am having trouble entering in the the index.php?area= prefix into the User Friendly configuration part of the modX manager, it just fails to direct me anywhere on test, simply refreshes the default page. It’s just important for him that the index.php? part is still part of the file extension, perhaps one day he’ll explain it to me why.
              That makes no sense to me, and what you are attempting to do is not possible in the prefix field without rewriting much of the core product. MODx uses index.php?q=alias for friendly urls; the mod_rewrite rules in .htaccess are responsible for converting a request to alias.html for instance, to index.php?q=alias.html
                • 29935
                • 4 Posts
                Well like I said, modx is still pretty new to us over here & was just trying to give to the client what they wanted. They didn’t want any mysite.com/about.html style laying out of objects, but if that is what it comes down to...then that is what it comes down to I suppose. Now I guess that brings me to another question...is there anyway, to clear old page IDs, that have been deleted, out of ModX’s history? For example, when we installed this last version we did, it gave us a bunch of pre-designed pages such as blog, sign in, etc...now those took up ID #’s all the way to 44 or 45. We’d like to start fresh with ID number & go back to 2 or 3, the lower based numbers. Anyway to do this? Again we are new to this so anyone saying my question is pointless, great...but won’t help me any. Thanks in advance.
                  • 25663 MODX Staff
                  • 12,272 Posts
                  Reinstall without any of the demo content. There’s no way to reset the IDs, which are used as keys for several parts of the MODx table structure.
                    Ryan Thrash, MODX Co-Founder
                    Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                    • 3749
                    • 24,544 Posts
                    The IDs are pretty much set in stone when the document is created. On the plus side, no one will ever see them but Manager users and eventually, they’ll learn that they are arbitrary and stop caring about their sequence.

                    For future reference -- if you’d like to keep them low, reuse documents rather than deleting them. When you want to delete a document, just make it unpublished. Then, when you need a new document, change it’s content to the new stuff and move it to where you want it in the tree.
                      Did I help you? Buy me a beer
                      Get my Book: MODX:The Official Guide
                      MODX info for everyone: http://bobsguides.com/modx.html
                      My MODX Extras
                      Bob's Guides is now hosted at A2 MODX Hosting