Questions tagged «mvc»

2
如何使所有URL通过单个PHP文件运行?
这些形式的URL的MVC系统如何通过单个index.php文件强制所有请求? http://www.example.com/foo/bar/baz http://www.example.com/goo/car/caz/SEO-friendly-name-of-the-object http://www.example.com/hey/you 编辑:当我尝试下面的重写规则时,出现此错误: [error] [client 127.0.0.1] Invalid URI in request GET / HTTP/1.1 [error] [client 127.0.0.1] Invalid URI in request GET /abc HTTP/1.1 编辑:哦,这是/index.php的完整内容。当我删除重写规则时,它将输出“ /”或“ /index.php”,否则我将得到404。 <?php echo htmlspecialchars($_SERVER['REQUEST_URI']); ?> 已解决:我在重写规则的index.php前面添加了一个/,然后它起作用了: 再次解决:原来只需要/,因为我正在运行2.2.4。当我升级到2.2.11时,不再需要/。
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.