Is there anyway using ModRewrite to achieve the following:
Initial URL: http://example.com/page?value=test
Rewirted URL: http://example.com/page/value/test
OR
Initial URL: http://example.com/page?value=test&fruit=apple
Rewirted URL: http://example.com/page/value/test?fruit=apple
I need this rule to be dynamic as I don’t know all the pages it is going to be used for and I also need to retain the $_GET variables in PHP.
Thanks
The question makes sense if the URLs in question are stored in the database, and need to be rewritten until the content can be updated to reflect the new URL pattern. Which, for clarification of the question, would be considered a redirect not rewrite, therefore improving SEO. Then, as the comments above point out, the URL could then be rewritten to provide PHP the correct URL parameters. If this what James intended, the config below will help out:
This is messy, but I’ve run into similar situations where redirecting old URLs stored in the database was necessary until content could be updated.
Hope this helps.