views:

36

answers:

1

I'm sure that's been asked zillions times but i can't get it to work, i'm trying to rewrite a url with querystring, my url is for example:

http://example.com/articles/index.php?keyword=book

and i want to be accessible from

http://example.com/articles/keyword/book/

I google it and i didn't have any luck, am i on the right track? i got this:

RewriteCond %{QUERY_STRING}     ^keyword=(.*)$    [NC]
RewriteRule ^/articles/index.php$         /articles/keyword/$1          [NC,L,R=301]

UPDATE

this is working fine

RewriteEngine On
Options +FollowSymLinks
RewriteBase /
RewriteRule ^.*/(\w+)\b$ /articles/index.php?keyword=$1
+2  A: 

It should work:

RewriteRule ^articles/keyword/(.*)/?$ index.php?keyword=$1

If not, please tell me ;)

fabrik
no, still doesn't work :|
JQman
What's the problem? What Apache gives? What's in the error logs?
fabrik
no, just getting 404
JQman
that finally worked for me,
JQman
that finally worked for me, RewriteRule ^.*/(\w+)\b$ /articles/index.php?keyword=$1
JQman