0
下面是我的.htaccess這個文件夾的文件。我的問題是,這些網址在PHP腳本收到時會分割$ _GET變量。
- /食品和飲食/用品/測試 - & -cake.html
- /food-and-diet/articles/test-%26-cake.html
兩者的這些URL創建此$ _GET數組:
Array ([article] => test- [-cake] => [folder] => none)
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 [L]
RewriteRule ^articles/([^.^/]+)/([^/]+)\.png$ articles/$1/$2.png [L]
Rewriterule ^articles/([^.^/]+)/([^/]+)\.html$ index.php?article=$2&folder=$1 [NC,L]
您是否必須在文件名中使用&? – dekomote 2010-09-24 23:11:18
我必須考慮到這個可能性,客戶問到這一點。 – Darpeh 2010-09-24 23:16:35