mod_rewrite with GET requests

Posted by iMaster on Stack Overflow See other posts from Stack Overflow or by iMaster
Published on 2010-06-02T16:35:32Z Indexed on 2010/06/02 16:53 UTC
Read the original article Hit count: 189

Filed under:
|
|

I have mod_rewrite working on most of my site. Right now I have a search that normally would point to

search.php?keyword=KEYWORD

And I'm trying to rewrite that to

search/?keyword=KEYWORD

Just to make it a little bit cleaner. So here's my mod_rewrite. (There are other rules I'm just posting the one that isn't working.)

RewriteRule ^search/?keyword=([^/\.]+)/?$ search.php?search=$1

When I type a search in the address bar way I want it to be, I get a page telling me its a "broken link" (I'm guessing that that's Chrome's equivalent of a 404 error). So what am I doing wrong? I think that the problem is the '=' or the '?' sign in the rule (the first part) because when I take the ?keyword= part out, it works. Does that make sense?

© Stack Overflow or respective owner

Related posts about apache

Related posts about .htaccess