Is it possible to include slashes in url parameter rule? Basically I want example.com/hello/world/ to go to example.com?q=hello/world/. Any examples would be appreciated.
An example of a rewrite rule that could accomplish this is:
This will capture everything after "example.com" and convert it to the q=x form.
I assume you are using Apache in front of some dynamic server-side program, like Tomcat or PHP, because Apache on its own can't really do anything smart with a URL containing a query string. In this case, you may need to add the [PT] flag to your Rewrite Rule, to ensure that the inbound URL gets rewritten before it is passed along to your dynamic engine. The rule would then look like:
You should also consider what will happen if your original inbound URL contains a query string of its own. This example rule will not include the inbound query string when it does the rewrite, but you can make it do so with the QSA flag.