简体   繁体   English

mod_rewrite问题

[英]mod_rewrite issue

I have the following rule: 我有以下规则:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico 
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

and my url is as follows: 而我的网址如下:

http://www.mydomain.com/189-9544737-0616922?%5Fencoding=UTF8&node=10

On myphp.php 在myphp.php上

var_dump($_GET): array(3) { 
  ["q"]=>  string(19) "185-8676848-3133633" 
  ["_encoding"]=>  string(4) "UTF8" 
  ["node"]=>  string(2) "10" } 

Any ideas? 有任何想法吗?

regards, 问候,

Try adding a B modifier: 尝试添加B修饰符:

Apache has to unescape URLs before mapping them, so backreferences will be unescaped at the time they are applied. Apache必须在映射URL之前取消转义URL,因此反向引用将在应用时取消转义。 Using the B flag, non-alphanumeric characters in backreferences will be escaped. 使用B标志,反向引用中的非字母数字字符将被转义。

RewriteRule ^(.*)$ index.php?q=$1 [B,L,QSA]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM