Page is a not externally linkable
andreasfriedrich - 2:53 pm on Oct 22, 2002 (gmt 0)
Quite frequently you use RewriteCond not for the condition it allows you to specify but for gaining access to and matching certain parts of a whole lot of server variables. RewriteCond takes the QUERY_STRING and tries to match 'id=' followed by one or more characters that are not &. Those characters are stored %1. You will need an additional RewriteRule (like the one in my previous post) to handle cases where there is no 'id=' in the query string since you made that a condition by specifying the RewriteCond. Andreas
You cannot access the query string in a RewriteRule. You would need to use RewriteCond [httpd.apache.org] %{QUERY_STRING} for that. RewriteCond defines a condition. The following RewriteRule is only used if this condition is met and the rewrite rule itself matches. RewriteCond %{QUERY_STRING} id=([^&]+)
RewriteRule ^widgets/(.*)\.htm$ /solar.php?pg=$1&cat=widgets&id=%1