2011-01-14 22 views
0

我的.htaccess:如何使用字符串的RewriteCond


Options FollowSymLinks 
RewriteEngine On  
RewriteCond %{QUERY_STRING} ^.*pg=p&kat=test&pod=1.*$ 
RewriteRule ^(.*)/(.*)/$ index.php?pg=p&kat=$1&pod=$2 
 

不`噸的工作,爲什麼呢?

我這樣一個測試:

RewriteCond %{QUERY_STRING} .*

和它的作品,所以Apache是​​好的。

回答

0

RewriteRule需要新的一行。

你改寫條件說的查詢字符串應該匹配

.pg=p&kat=test&pod=1. 

,然後你重寫規則試圖匹配

^東西/某事/

當然這應該是

^/(.)/(.)/$ 

so ...你打什麼網址?

0

對不起,的RewriteCond,我有什麼:

 

RewriteCond %{QUERY_STRING} ^.* pg=p&kat=test&pod=1.* $ 
RewriteRule ^(.*)/(.*)/$ index.php?pg=p&kat=$1&pod=$2

之間的空間( 「* 」和 「PG」)和(「 *」 和 「$」)不`噸存在於.htaccess文件

ofcourse重寫規則是在新的生產線

我真的打網址:www.test.pl/tested/1/

相關問題