小编Dar*_*peh的帖子

.htaccess & 和 %26 都拆分 $_GET

下面是这个特定文章文件夹的 .htaccess 文件。我的问题是这些 url 在被 php 脚本接收时都拆分了 $_GET 变量。

  1. /food-and-diet/articles/test-&-cake.html
  2. /food-and-diet/articles/test-%26-cake.html

这两个 url 都创建了这个 $_GET 数组:

Array ( [article] => test- [-cake] => [folder] => none )
Run Code Online (Sandbox Code Playgroud)
Options +FollowSymLinks
    RewriteEngine On
    RewriteBase /food-and-diet/
    RewriteRule ^.+(/css/.+)$ $1 [L]
    RewriteRule ^.+(/js/.+)$ $1 [L]
    RewriteRule ^.+(/images/.+)$ $1 [L]
    RewriteRule ^\index.html$ index.php [NC,L]
    Rewriterule ^articles/?$ index.php?index=$1&article=none&folder=none [NC,L]
    Rewriterule ^articles/([^.^/]+)/?$ index.php?article=none&folder=$1 [NC,L]
    RewriteRule ^articles/([^/]+)\.jpg$ articles/$1.jpg [L]
    RewriteRule ^articles/([^/]+)\.gif$ articles/$1.gif [L]
    RewriteRule ^articles/([^/]+)\.png$ articles/$1.png [L]
    Rewriterule ^articles/([^/]+)\.html$ index.php?article=$1&folder=none [NC,L]
    RewriteRule ^articles/([^.^/]+)/([^/]+)\.jpg$ articles/$1/$2.jpg [L]
    RewriteRule ^articles/([^.^/]+)/([^/]+)\.gif$ articles/$1/$2.gif …
Run Code Online (Sandbox Code Playgroud)

.htaccess urlencode

0
推荐指数
1
解决办法
2274
查看次数

标签 统计

.htaccess ×1

urlencode ×1