We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

How to create RewriteRule

Hi, Even have seen the rule in the INVO exmplae but I still don't understand how to write a new rule I want mySite/job/item/item_number to actually point mySite/job/item?Numid=item_number. so actually I will be able to use $_GET[''item_number];

Please help



7.0k
Accepted
answer

Hi ! Are you you want to use a RewriteRule ? In fact in Invo's example the rewrite rule just set the root of you're website. If i understand well your concern you may use the router ;)

https://docs.phalcon.io/en/latest/reference/routing.html

There you won't have to use $GET because Phalcon make it already for you. I'll let you discover the router, don't hesitate to come back if you need more help

Thanks , that's exactly what I was looking for , to complete the whole picture of using Route , one should also follow the following: https://stackoverflow.com/questions/13895491/how-router-roites-could-be-injected-in-application-in-phalcon-framework