I'm getting some problems creating a rewrite rule. The url I wish to rewrite and ultimately redirect includes a search query inside it and appears such as this:

http://www.mysite.com/pages.php?category=fruit

I must redirect it to:

http://www.mysite.com/pages.php/fruit

The initial address doesn't exist anymore. I've attempted to create a rewrite but this really is less than working the way i would like it to work

RewriteEngine on 
RewriteCond %{QUERY_STRING} =category=fruit` 
RewriteRule ^pages\.php$ pages.php/fruit/ [L,R=301]

would go to

http://www.mysite.com/home/linux123/m/mysite.com/user/htdocs/pages.php/fruit/

Any suggestions about fixing the making of the rewrite rule could be great. Thanks ahead of time.

The way in which URL spinning works is it takes non-existant URL and rewrites it to suggest to the one which is available. The non-existant URL is much more of presentation factor as opposed to a functional factor. You do it the opposite way round, the hyperlinks in your webpages ought to be like http://www.mysite.com/pages.php/fruit so when the consumer clicks them they ought to internally be submitted to something similar to this http://www.mysite.com/pages.php?category=fruit. The rewrite rule needs to be written accordingly which may be

^pages\.php/([A-Za-z])*$ pages.php?category=$1 [NC,L]

when the category is strictly alphabetical otherwise for alphanumeric

^pages\.php/([A-Za-z0-9])*$ pages.php?category=$1 [NC,L]

You may also test out your regex rewrite rules by using this online validator

Regex Validator

Hope this can help..