how do websites do this index.php?something=somepage

前端 未结 6 1212
有刺的猬
有刺的猬 2020-12-16 08:07

i\'ve seen alot of php based websites where no matter where you navigate your stuck at the index.php and some random parameters are passed in the url. and when i take a look

6条回答
  •  不知归路
    2020-12-16 08:22

    You are looking at websites built with a front controller.

    http://en.wikipedia.org/wiki/Front_controller

    Many popular PHP apps like Joomla use it to treat a collection of scripts as a cohesive application.

    A front controller is a good idea for languages like PHP, but remember to hide the front controller with something like mod_rewrite to create URL canonization and to optimize readability.

提交回复
热议问题