In my main plugin file I have the following code in my registerCpRoutes fucntion:

public function registerCpRoutes()
    return array(
        'campaignreports/subscribers/detail\/(?P<listId>\d+)' => 'campaignreports/subscribers/_detail/'

I have a _detail.html template located in /templates/subscribers/_detail.html

For some reason this doesn't seem to work. I keep on getting a "Page not found" error. As far as I can tell I have followed the docs on dynamic routing Any ideas on what is going wrong here?

PS: I have uninstalled & reinstalled the plugin


Not sure why you are escaping the / right in front of the regex. Maybe thats the issue?

  • Also I think you have to remove the trailing / after _detail
    – pythic
    Aug 8 '14 at 15:53

Fresh week, fresh look at things. I failed to notice that the regex was set to \d and my campaignmonitor "id" contained alphabetic characters.
Changing it to \w fixed it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.