RE: [PHP] Re: What's wrong with this rewrite rule?
| From: | Chris W. Parker | Date: | Wed, 02 Feb 2005 20:09:43 +0000 |
| Subject: | RE: [PHP] Re: What's wrong with this rewrite rule? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-207928@lists.php.net to get a copy of this message | ||
Michael <mailto:phpnews@mas.ml1.net>
on Wednesday, February 02, 2005 11:54 AM said:
> You're insisting that the path to rewrite start with d. It's not going
> to start with d, it's going to start with /. As in "/detail.asp"...
>
> Easy thing to miss, though...
Actually that's not why. None of my other rules begin with a /. The
problem is because mod_rewrite does not handle the query string by
default. You have to setup a special rule for that.
Here is the solution:
RewriteCond %{QUERY_STRING} product_id=([\w-]+)
RewriteRule ^detail\.asp product.php?id=$1
Chris.