.htaccess 未正确重定向


.htaccess not redirecting properly

我已经安静了 stackoverflow.com,但我相信我没有找到我要找的东西。所以,它来了。我有一个正确重定向的 .htaccess 文件,但我有一个远程测试服务器,它似乎不像我的开发人员机器那样重定向,这可能是服务器的 apache2 处理程序配置不正确吗?好的,代码如下。

RewriteRule ^welcome?(.*)                   public/index.php    [L]
RewriteRule ^profile?(.*)                   public/index.php    [L]
RewriteRule ^password?(.*)                  public/index.php    [L]
RewriteRule ^verify(.*)                 public/index.php    [L]
RewriteRule ^(.*)$ main.php?%{QUERY_STRING}     [L]

现在,main.php文件处理所有传入的请求,甚至欢迎,配置文件,密码,验证。 但是现在,我只想将特定文件重定向到公共/索引.php文件,它在我的开发人员机器中执行此操作,但远程服务器?

Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /
RewriteRule ^(welcome|profile|password|verify) public/index.php [NC,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/(welcome|profile|password|verify) [NC]
RewriteRule ^(.*)$ main.php [QSA,L]

试一试。