After asking this: Clean URL's for search query? I attempted something with mod_rewrite:

RewriteCond %{QUERY_STRING} ^s=([a-z]+)$ [NC]
RewriteRule / /s/$1? [NC,R=301,L]

RewriteRule ^s/([a-z]+)$ /?s=$1 [NC,L]

What is the goal?

  1. Redirect http://example.com/?s=query to http://example.com/s/query
  2. Rewrite http://example.com/s/query to http://example.com/?s=query

This appears like double work but when you have a look the thing is things i attempt to accomplish:

  1. Redirect any search querystring to some cleaner equivalent (whether it's a form, or somebody typing it in directly)
  2. Rewrite (not redirect) that URL to dynamic querystring to ensure that I'm able to have it with PHP via $_GET

Basically consider it such as this it ought to be possible. So I must seek the assistance from the experienced mod rewriter that helped me to by helping cover their that one.

Number Two works but that is it.

This will work, I examined it with a few different names and dirs, but that needs to be ok inside your situation.

NB: for matched up group in the RewriteCond you have to use %1 not $1.

RewriteCond %{QUERY_STRING} ^s=([a-z]+)$ [NC]        
RewriteRule ^$ /s/%1? [NC,R,L]                     

RewriteRule ^s/([a-z]+)$ /?s=$1 [NC,L] 

Edit for debug (see comments) :

my test is :

| /
| --> doc
|   |
|   --> doc.php (takes doc as GET parameter)
|     | index.php

My apache rewrite is

RewriteCond %{QUERY_STRING} ^doc=([a-z]+)$ [NC]
RewriteRule ^$ /doc/%1? [NC,R,L]

RewriteRule ^doc/([a-z]+)$ /doc/doc.php?doc=$1 [NC,L]

Then requesting domain.com/?doc=query shows doc is query

Works best for me.