How to use strings in RewriteCond
My .htaccess:
Options FollowSymLinks
RewriteEngine On
RewriteCond %{QUERY_STRING} ^.*pg=p&kat=test&pod=1.*$
RewriteRule ^(.*)/(.*)/开发者_运维百科$ index.php?pg=p&kat=$1&pod=$2
doesn`t work, why ?
I tested this one:
RewriteCond %{QUERY_STRING} .*
And it works, so apache is ok.
RewriteRule needs to go on a new line.
Your rewrite condition says the query string should match
.pg=p&kat=test&pod=1.
and then your rewrite rule tries to match on
^something/something/
Surely that should be
^/(.)/(.)/$
?
so... what URL are you hitting?
Sorry, rewritecond, what i have:
RewriteCond %{QUERY_STRING} ^.* pg=p&kat=test&pod=1.* $
RewriteRule ^(.*)/(.*)/$ index.php?pg=p&kat=$1&pod=$2
Space between (" * " and "pg") and (" * " and "$") doesn`t exists in .htaccess file
ofcourse RewriteRule is in new line
I`m hitting URL: www.test.pl/tested/1/
精彩评论