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
I think your client needs to have his or her head examined.
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
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.
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.
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.
-
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
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.