Manage URL routes in own php framework

前端 未结 12 2136
盖世英雄少女心
盖世英雄少女心 2021-02-02 16:34

I\'m creating a PHP Framework and I have some doubts...

The framework takes the url in this way: http:/web.com/site/index

It takes the first paramet

12条回答
  •  粉色の甜心
    2021-02-02 17:00

    Forget about "reinventing the wheel is wrong" claims. They don't have to use our wheels. I walked on the same road a while ago and i'm totally grateful what i get... i hope you will too

    When it comes to the answer to your specific problem -which if faced too- there is a very easy solution. it's a new line in .htaccess at root folder...

    Just add line below to your root .htaccess file ; (if your subfoler is "subfolder" )

    RewriteRule subfolder/ - [L]
    

    This will leave apart this folder from rewriting directives

    By using this way you can install as many instances of your framework as you wish. But if you want this to be framework driven then you have to create/change .htaccess within your framework.

提交回复
热议问题