php - Custom querystring-based routing in CodeIgniter or Phalcon
I develop webapps for a relatively large enterprise. In order to follow the company's security policy of only using obfuscated URIs, I usually use a homebrew framework using the front controller pattern.
Before obfuscation, the URIs come in this format:
domain.com/app_name/index.php?controller=A&action=B
The entire query string gets processed first when generating links to produce URIs in this format:
domain.com/app_name/index.php?q=Y29udHJvbGxlcj1BJmFjdGlvbj1C
where the value ofq
isurlencode(base64_encode('controller=A&action=B'))
The front controller will, on receiving a request, first decode the value ofq
and then set the parameters to$_GET
, then the appropriate controller and action will be called based on that.
I'm about to start working on a new project and I want to try using a framework, either CodeIgniter (which I'm relatively familiar with) or Phalcon (which I would like to try). How do I implement this URI routing scheme in either framework? From my understanding both by default uses segment-based routing.