What you describe might normally be done by structuring the URLs the other way around, e.g.I see your point and it would obviously make life so much easier, but there are two reservations, the main one being SE consideration -> building a common theme around Albert Einstein vs. around Numerology. Hence, in the eyes of search engines, the parent "folder" must be that of the celebrity name.
numerology-profile/albert-einstein.html
I don’t think you can play with the "alias" in the way that you are... that’s just a feeling I have. Sure, WayFinder and other Snippets can read that value from the database and display it, because they’re not actually doing anything with it. When a page request comes in to a site, though, I don’t think Apache has time to play around with the URL. I think MODx does a quick and dirty lookup to find the relevant page to load.That concurs with the findings of my tests. I just wanted to make sure that I haven’t missed anything as a newbie.
How many pages have you tried using the [+URLprefix+] on? Aren’t you running into restrictions on unique aliases?Just tried a few and didn’t run into any non-unique alert, even though I have selected this option in site FURL settings.
What would be more common in MODx would be that you create a page with an alias of "albert-einstein", and then create a another page under that page with a "numerology-profile" alias. But that architecture may be totally redundant.Inconceivable with 115K and more celebrities.
Can you verify that friendly URLs are working on "normal" pages on your site?No problems whatsoever.
Another way to do this might be to put PHP code at a page above the people. e.g. if you had www.yoursite.com/people/albert-einstein/numerology-profile.html, then you could put a Snippet in the "people" page that would grab URL segments. That’s how some other CMS’s do it (e.g. Expression Engine).What a fantastic idea. Thanks a bunch. What you actually suggest is to substitute htaccess rules or 404 page script with a snippet that will Server.Transfer calls from the people document to index.php?id=<case by calling URL>&FileName=<extracted from URL>. Seems like a great way to preserve business logic within the MODx application, without depending on external files and platforms (such as IIS with no ISAPI_Rewrite).
The one last thought I have is that you put the existing code you wrote to parse your [+URLprefix+] placeholder into a Plugin (not just a Snippet). The reason is because a Snippet executes when a page loads, and you don’t have a choice when in the loading the Snippet executes... it will always be at the same time... and it may be too late for what you are trying to do. If you make a Plugin, however, you can set the Plugin to execute at an event earlier in the loading sequence.I haven’t got my hands dirty with plugins yet. Thanks for the tip. Luckily - all template and document parsing are working flawlessly as is because the function $modx->setPlaceholder() forces the script to interpret such values prior to the rendering phase.
$url = $modx->makeURL($id); $modx->sendRedirect($url);
I’m not sure I’m following this completely, but if you are using a snippet and the snippet knows the id of the page you want, you could use:
$url = $modx->makeURL($id); $modx->sendRedirect($url);
and MODx will work out the details and send the user directly to the page.


RewriteRule ^([^/]*)(/)?$/numerology-profile/ /numerology-profile/?FileName=$1 [nc]
RewriteRule ^([^/]*)(/)?$/numerology-profile/ /numerology-profile/?FileName=$1 [nc]
/albert-einstein/numerology-profile/ to /numerology-profile/?FileName=albert-einstein
RewriteRule ^([^/]*)(/)?$/birth-data/ /birth-data/?FileName=$1 [nc]
Tools->Configuration->Friendly URLs->
* Prefix for friendly URLs: [+FileName+]/
* Suffix for friendly URLs: /
Another way to do this might be to put PHP code at a page above the people. e.g. if you had www.yoursite.com/people/albert-einstein/numerology-profile.html, then you could put a Snippet in the "people" page that would grab URL segments. That’s how some other CMS’s do it (e.g. Expression Engine).
// Manager tree view
Holidays (container)
-> Offers (container)
--->[+id+] (page)