1

htaccess 不匹配

RewriteCond     %{REQUEST_URI}           ^/catalog/products_in_scene.php?(.*)$
RewriteRule     ^(.+)                    "/services/hpv/index.php?%1"


RewriteCond     %{REQUEST_URI}           ^/shop/derivation_tree.php?(.*)$
RewriteRule     ^(.+)                    "/services/dt/index.php?%1"

第一个与所有 GET 变量匹配良好,第二个匹配并将我发送到正确的页面,但从不发送 GET 变量;为什么?

4

3 回答 3

0

你最好使用[QSA]标志:

RewriteRule ^/shop/derivation_tree.php  /services/dt/index.php [QSA]
于 2012-06-08T15:24:14.697 回答
0

从您的 RewriteRule 中删除引号。

如果它不起作用,则意味着您的 php GET 变量有问题。

于 2012-06-08T11:42:41.080 回答
0

将您的代码更改为:

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

RewriteRule ^catalog/products_in_scene\.php$ services/hpv/index.php [R,L,NC]

RewriteRule ^shop/derivation_tree\.php$ services/dt/index.php [R,L,NC]
于 2012-06-08T19:14:58.970 回答