CodeIgniter Forums
Wildcard first uri segment - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Wildcard first uri segment (/showthread.php?tid=73906)



Wildcard first uri segment - Leo - 06-22-2019

Hello all!
I'm currently tasked with development of a multi regional website. I have to have similar services in different locations.
I need to make a first segment as a wildcard - like this:

website.com/new-york/services/notebook-repairs
website.com/new-jersey/services/notebook-repairs
website.com/los-angeles/services/phone-repairs
website.com/some-other-town/blog

Basically I need the first segment of my uri to be a wildcard that will be determined by clicking on location choice at the start of the website. Does anyone have any experience or good examples with this? Please help.


RE: Wildcard first uri segment - InsiteFX - 06-22-2019

I found this one may help you get started.

How to organize country/state/city browsing in codeigniter url


RE: Wildcard first uri segment - Leo - 06-22-2019

And it did. Thanks! I feel silly for learning this after 3 years of work with CI....dang
Well for anyone who may stumble upon this here you go...

$route['(:any)/(:any)'] = 'front/category/$1/$2';