Seems like I’m talking to myself but I’m still going strong and I have a solution (which could be integrated in next versions of modX maybe?):
1: I created a plugin to convert the request uri into an array. Because you need keys and values I chose this way:
myurl.com/key1/var1/key2/var2 converted into an array: array("key1" => "var1", "key2" => "var2");
The plugin:
if(!empty($_SERVER['REQUEST_URI'])) {
$get = explode('/', substr($_SERVER['REQUEST_URI'], 1));
for ($i = 0; $i < count($get); $i++)
if ($i % 2)
$url[$key] = $get[$i];
else
$key = $get[$i];
} // end if
$modx->urlVars = $url;
// This plugin is in development, any tips on how things can be done in a more easy way are
very welcome
Works fine on the homepage but as soon as I navigate to a subpage and add use an url like
http://www.mysite.nl/alias/key1/val1, things stopped working, I got redirected to the homepage. So I started to look in the documentparser class: manager/includes/document.parser.class.inc.php
On rule 323 I found the function which is responsible for translating the URL into the correct pageID or alias. To achieve my goals I changed the following (this code block starts on line 332):
if ($this->config['use_alias_path'] == 1) {
$this->virtualDir= dirname($q);
$this->virtualDir= ($this->virtualDir == '.' ? '' : $this->virtualDir);
$q= basename($q);
} else {
$this->virtualDir= '';
}
into
if ($this->config['use_alias_path'] == 1) {
$this->virtualDir= dirname($q);
$this->virtualDir= ($this->virtualDir == '.' ? '' : $this->virtualDir);
$q= basename($q);
} else {
$this->virtualDir= '';
$arr = explode('/',$q);
$q = $arr[0];
}
Notice the changed else statement. What this code does is exploding the queryURL and stripping everything except for the item after the first /. Unfortunately this can’t be achieved easily when working with alias_paths. So i’m still thinking about a solution for this.
What do you think of my solution? Did I overlooked anything?
Now I’m continuing to develop the plugin, if anyone is interested I’ll post it here when i’m done (or getting further

). But i’ll see that when someone ends my monologue in this thread...