.htaccess rewritebase + index file url not ofsetting (PHP /


.htaccess rewritebase + index file url not ofsetting (PHP / Apache)

ok,

所以这是我的.htaccess,重写库设置为/abc/public/。索引.php文件位于/public/文件夹中,该文件夹是/abc/的子文件夹。

RewriteEngine On
Options -Indexes
RewriteBase /abc/public/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]

如果我从脚本中检索$_GET['url']值,则始终$url[0]索引处public值。现在,如果重写基设置为 /abc/public/.php为什么将public传递给索引?

它不应该在/public/之后开始传递值吗?所以说我有/abc/public/method/params/,如果我输出print_r($url),我不应该得到$url[0] = 'method', $url[1] = 'params'吗?

似乎无法弄清楚这一点。

编辑:

模组,请忽略最后一个标志。事实证明,这个问题毕竟是相关的。

我相信

.htaccess没有根据您的RewriteBase值放置在正确的目录中。例如,如果您正在使用:

RewriteBase /abc/public/

那么.htaccess的正确位置应该是:

%{DOCUMENT_ROOT}/abc/public/