Answer the question
In order to leave comments, you need to log in
How can I fix the cnc rule in htaccess?
Good afternoon.
There is a line: ?page=product&item=888
In the htaccess file I write a rule for it:
RewriteEngine On
RewriteRule ^product/(.*)/$ index.php?page=product&item=$2 [L]
The rule does not work. Tell me what's wrong?
Answer the question
In order to leave comments, you need to log in
give me the two lines that have become, because you made a mistake at the very beginning
GET is not part of the line, why are you trying to select it?
# 301 --- http://www.test.com/product/333 => http://www.test.com/index.php?page=product&item=888
RewriteRule ^product/333$ /index.php\?page=product&item=888 [L,R=301]
# 301 --- http://www.test.com/?page=333 => http://www.test.com/index.php?page=product&item=888
RewriteCond %{QUERY_STRING} (^|&)page\=333($|&)
RewriteRule ^$ /index.php?page=product&item=888 [L,R=301]
# 301 --- http://www.test.com/?page=333 => http://www.test.com/index.php?page=product&item=888
RewriteCond %{QUERY_STRING} (^|&)page\=([0-9]{1,})($|&)
RewriteRule ^$ /index.php\?page=product&item=%2 [L,R=301]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question