Redirect all to index.php using htaccess

后端 未结 7 2253
情话喂你
情话喂你 2020-11-22 14:08

I\'m writing a simple PHP-based MVC-ish framework. I want this framework to be able to be installed in any directory.

My PHP script grabs the request uri and breaks

7条回答
  •  醉话见心
    2020-11-22 14:46

    You can use something like this:

    RewriteEngine on
    RewriteRule ^.+$ /index.php [L]
    

    This will redirect every query to the root directory's index.php. Note that it will also redirect queries for files that exist, such as images, javascript files or style sheets.

提交回复
热议问题