我有一个 apache 头痛,我正在寻找一些 stackoverflow advil。
这是.htaccess。
php_flag display_errors off
RewriteEngine On
# Redirect everything to the Front COntroller
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule !^(css|images|files)/ index.php [NC,L]
这是它在服务器 A 上的处理方式:
- 要求:
http://mysite.com/blog - 请求被路由到 index.php
$_SERVER[REQUEST_URI]解决为blog
这是在Server Nightmare B 上的处理方式:
- 要求:
http://mysite.com/blog - Apache 发起 http 调用
http://mysite.com/index.php $_SERVER[REQUEST_URI]解决为index.php
我要做的就是将请求重新路由/写入 index.php,而$_SERVER[REQUEST_URI]不是更改为index.php. 在上面的示例中,我想在服务器 A 和服务器 B 上$_SERVER[REQUEST_URI]解析到blog- 但它在服务器 B 上不起作用。
有人可以告诉我为什么会这样吗?