When using Settings -> Routes in the CMS with wildcard, routes.php does not work
I don't know if it's great practice to do this but if you want a "wildcard", especially as your first segment, you should a) put it in your routes.php manually b) make it the last route (always) otherwise it will take precedence just as you said and the other routes won't work. Also, using regex in your named parameters is good practice, if you are sure that teamid&gt; is always and only a number, you could do this &lt;teamid:\d+&gt; so that someone visiting contact-us/peanuts would get a 404.

As far as setting this catch all route you want, just use a named parameter again:

'&lt;anything&gt;/&lt;teamid:\d+&gt;'         =&gt; ['template' =&gt; 'pages/index'],


This would have your catch all effect and will allow you to fetch the first segment if you need to. 

If you expect a certain format for this first segment, in your template by calling {{ anything }} you could do some sort of validation. Also you could use regular expression to narrow the possibilities down a bit... With this as is, 500shoes/54896 would return your index page...

Hope that helps :)