Apache重写行为更改 - 取决于服务器

时间:2013-08-16 17:03:11

标签: php apache .htaccess

我遇到了麻烦,我正在寻找一些stackoverflow的建议。

这是.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:

的处理方式
  1. 请求:http://mysite.com/blog
  2. 请求被路由到index.php
  3. $_SERVER[REQUEST_URI]解析为blog
  4. 这是服务器梦魇 B:

    的处理方式
    1. 请求:http://mysite.com/blog
    2. Apache对http://mysite.com/index.php
    3. 进行http调用
    4. $_SERVER[REQUEST_URI]解析为index.php
    5. 我要做的就是将请求重新路由/写入index.php,而不将$_SERVER[REQUEST_URI]更改为index.php。在上面的示例中,我希望$_SERVER[REQUEST_URI]在服务器A和服务器B上解析为blog - 但它不能在服务器B上运行。

      有人可以告诉我为什么会这样吗?

0 个答案:

没有答案