0

我添加了 RewriteCond ,它应该从重定向中省略管理目录。但是它继续像这样发送 URL

http://www.site.tld/admin/software/windows/edit/148http://www.site.tld/help.php

我在这里做错了什么?一直在尝试解决这个问题......

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/admin/
</IfModule>
RedirectMatch 301 /en/(.*) /$1
RedirectMatch 301 /windows/(.*) /$1
RedirectMatch 301 /home/os/(.*) /os/$1
RedirectMatch 301 ^/software/add_version/(.*) http://www.site.tld/help.php
RedirectMatch 301 ^/edit/(.*) http://www.site.tld/help.php
RedirectMatch 301 ^/software/edit/(.*) http://www.site.tld/help.php
RedirectMatch 301 ^/software/add_image/(.*) http://www.site.tld/help.php
4

1 回答 1

1

RewriteCond %{REQUEST_URI} !^/admin/只会匹配/admin/文件夹。用这个:

RewriteCond %{REQUEST_URI} !^/admin/.*$
于 2013-01-26T05:36:53.713 回答