Routing: How can I ignore a parameter in route definition?
It sounds like you might be trying to blend Craft/Yii routing with Rewrites (if you're coming from an Apache background).

I believe what Craft interprets this as is an attempt to map a request to locations/or/my-entry-slug to the &lt;slug&gt; (literal) action of the locations controller (which doesn't exist).

If you just want to render a template for these entries, you can set up your route like this:

'locations/&lt;state:[a-z]{2}&gt;/&lt;slug:{slug}&gt;' =&gt; ['template' =&gt; 'locations/entry']


This way, you'll get a state and slug variable in the templates/locations/entry.twig template, with which you can look up the Locations Entry you want.

To troubleshoot further, we might need a bit more information about how your Locations Section is set up, and the goals for the route!


  If you're just looking to capture and redirect legacy URLs, be sure and check out the Retour plugin.
  
  Additionally (and for anyone who finds this in the future), I'd recommend reviewing the advanced routing docs.