【发布时间】:2012-12-02 16:58:07
【问题描述】:
我的目录结构如下。
public_html/
/abc/
/xyz/
/pqr/
在abc,xyz,pqr这几个目录下都有一个index.php。
现在只要有任何像domain.com/abc/def/ghi 这样的请求都应该重写为domain.com/abc/index.php/def/ghi
domain.com/xyz/def/ghi => domain.com/xyz/index.php/def/ghi
domain.com/pqr/def/ghi => domain.com/pqr/index.php/def/ghi
.htaccess 文件应该是什么,应该放在哪里?
我在每个目录(abc,xyz,pqr)中都有 .htaccess 文件,如下所示,但它不起作用。它显示 404 页面未找到。请指导我处理所有这些重写条件。
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
但这不起作用...如果这是正确的 .htaccess 那么请告诉我是否还有其他服务器端问题。我在 CentOs 服务器上设置这个。
【问题讨论】:
标签: .htaccess mod-rewrite fuelphp