Can't get wildcard URL working with CustomRequest

I’ve got CustomRequest working fine with a specified resource, but can’t get it to work use a wildcard URL rather than a specific resource.

Ideally, I want this URL,and any other URLs that end with “speaker-info”, to strip off the last bit and send it as a request variable, “speakernamelink”. :

[mysitedomain]/2024/speaker-info/Speaker%20Name

The config I used was:

Screen Shot 2024-07-05 at 5.56.53 PM

That wasn’t working so I tried this config:,
Screen Shot 2024-07-05 at 5.45.13 PM

and expected this URL to work:
[mysitedomain]/2024/speaker-info/speakername/Speaker%20Name

but it doesn’t. What am I missing?

CustomRequest 1.3.9, MODX 2.8.7

Your first solution (Alias Path = #.*?\/speaker-info# | URI Parameter = ["speakernamelink"]) should work.

If you have a resource with “alias” = speaker-info and “Container” = true, a request to https://yourdomain.com/2024/speaker-info/SpeakerName is forwarded to https://yourdomain.com/2024/speaker-info/ and the parameter “speakernamelink” is set to SpeakerName.

“Container” has to be true??


Update:
Yes, “container” has to be true! But why? It doesn’t have to be true if you specify a resource in the settings. The correct resource now loads. But, with “container” set to true, this also works: #.*?speaker-info# (without the initial slash).

When the code tries to find a matching resource, it adds a trailing slash to the alias (see the line of code linked below). I don’t know exactly why. But a trailing slash does also get added to container URLs (see column uri in the database table modx_site_content).

Maybe the code should be altered to also search for the alias without the trailing slash.