且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

mod重写和查询字符串

更新时间:2023-02-26 12:00:28

最简单的方法是在 PHP 代码中进行大部分解析.

The easiest way is to do most of the parsing in PHP code.

使用像这样的重写器

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d    
RewriteRule . index.php [L]

然后从 PHP 访问请求 uri ($_SERVER['REQUEST_URI']),并根据需要将其解析为多个部分.

And then access the request uri ($_SERVER['REQUEST_URI']) from PHP, and parse it into as many parts as you want.