Apache fast cgi mod_rewrite:没有输入文件

时间:2010-01-20 09:50:31

标签: mod-rewrite

  • / index / /index.php

  • / index / hello /index.php/hello

该网站使用path_info,默认规则不起作用:

RewriteRule ^([^/]+)/(.*)$      $1.php/$2   [L]

我改为:

RewriteRule ^([^/.]+)((/[^/]+)*)/?$ $1.php$2 [L]

那很奇怪

  • * / index / to /index.php 工作正常

  • / index / hello /index.php/hello 不起作用

它表示未指定输入文件。

Php在Apache中以 fast cgi 模式运行。

1 个答案:

答案 0 :(得分:0)

path_info在每个服务器以及Webserver和PHP的组合上都有所不同。为什么不使用GET变量进行路由?

RewriteRule ^([^/.]+)((/[^/]+)*)/?$ routing.php/?site=$1&module=$2 [L]