Rewrite rule not right,how to correct it

when i close the rewrite. the url like the following:

http://example.com/about.php
http://example.com/about.php?id=42
http://example.com/products.php?id=43
http://example.com/products_show.php?cid=49&id=46

now i using the following code in .hactess file

RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^index.html$ index.php
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^about-([0-9]+)-([0-9]+)\\.html$ about.php?cid=$1&page=$2
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^product-([0-9]+)\\.html$ product.php?cid=$1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^productshow-([0-9]+)-([0-9]+)\\.html$ productshow.php?cid=$1&id=$2

Other pages are ok except product detail page and

 http://example.com/about.php?id=42 

.what’s wrong with the code? thank u.

Hello again, red!

Personally, I won’t use the RewriteBase / directive in the DocumentRoot - it’s superfluous.

Then, you’re checking for the presence of a query string without remembering that (.*) is the :kaioken: EVERYTHING :kaioken: (or NOTHING) atom. In other words, you are deleting a pre-existing query string EVERY TIME (so why use the {REWRITE_COND} statements at all}?) and redirecting to a php script (NOT loopy).

about.php?id=42 does not match any regex so it will survive and be processed by the PHP engine.

Regards,

DK