Regex htaccess重定向不工作。给出404

Regex htaccess重定向不工作。给出404,regex,apache,.htaccess,mod-rewrite,redirect,Regex,Apache,.htaccess,Mod Rewrite,Redirect,我使用的是slim框架,它有以下.htaccess Options -Multiviews Options +FollowSymLinks <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)?$ index.php?url=$1 [NC,L,B,Q

我使用的是slim框架,它有以下
.htaccess

Options -Multiviews
Options +FollowSymLinks
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)?$ index.php?url=$1 [NC,L,B,QSA,NE]
</IfModule>
但是我得到了
404
错误。有人能帮我吗

更新:
mod_rewrite
已启用,
/about/
工作正常。我需要
index.php?q=about
来显示相同的页面。

您可以使用:

Options +FollowSymLinks -Multiviews
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

# redirect /index.php?q=about to /about
RewriteCond %{THE_REQUEST} \s/+index\.php\?q=([^\s&]+) [NC]
RewriteRule ^ /%1? [R=302,L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [L,QSA]
</IfModule>
Options+FollowSymLinks-多视图
重新启动发动机
重写基/
#重定向/index.php?q=about to/about
RewriteCond%{THE_REQUEST}\s/+index\.php\?q=([^\s&]+)[NC]
是否重写规则^/%1?[R=302,L]
重写cond%{REQUEST_FILENAME}-D
重写cond%{REQUEST_FILENAME}-F
重写规则^(.*)$index.php?url=$1[L,QSA]

您的服务器是否启用了
模式\u rewrite
并打开了?是的
/about/
工作得很好尝试一下这样的方法:
在RewriteRule上重写引擎^([^/]*)$/index.php?q=$1[L]
@Latheesan这完全不起作用。。。
Options +FollowSymLinks -Multiviews
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

# redirect /index.php?q=about to /about
RewriteCond %{THE_REQUEST} \s/+index\.php\?q=([^\s&]+) [NC]
RewriteRule ^ /%1? [R=302,L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [L,QSA]
</IfModule>