i'm using APACHE:mod_rewrite to define some rules for rewritting Web addresses

i would like this link                                                           to be shown as

/myDIR/walls.php?f=All&of=0&s=Newest -> All.html

and so i am while using following rule

text from (.htaccess)

RewriteEngine  on
RewriteBase    /myDIR/   
RewriteRule ^All\.html$  papers.php?f=All&of=0&s=Newest

now these variables which are being passed as f=All of=0 s=Newest these are used in query, Clearly, and one of these simple variables, i.e f sometimes has values with spaces and special figures, and that i can't avoid that since the database has already been in-place and all sorts of i'm doing rewrite of Web addresses....

NOW after i attempt to define a guide such as this

i would like this link                                                                                          to be shown as

/myDIR/walls.php?f=Characters & Supers&of=0&s=Newest -> Characters & Supers.html

that is wrong i understand since there should not be any spaces.. so to really make it right i define the rule such as this

RewriteRule ^Characters%20%26%20Supers\.html$  papers.php?f=Characters%20%26%20Supers&of=0&s=Newest

it allows me define the rule however when i click my link i recieve this 404 Not Found Error "The asked for URL /wallz/Figures &lifier Supers.html wasn't available on this server."

QUESTION: How To Proceed ?

my prediction is i'm not said to be doing HTML URL Encoding inside .htaccess

Your guess is correct. When that the URL has arrived at mod_rewrite for processing, Apache has decoded the URL for you personally. Therefore, if you wish to look for any otherwise-encoded figures, you should utilize their literal representations.

Since whitespace can be used like a delimiter here, you'd should also escape your spaces:

RewriteRule ^Characters\ &\ Supers\.html$ papers.php?f=%0&of=0&s=Newest

In my opinion that using quotes will even work, therefore the following ought to be equivalent (climax untested):

RewriteRule "^Characters & Supers\.html$" papers.php?f=%0&of=0&s=Newest

Your final note about Apache's decoding process is it will instantly remove multiple slashes for you personally. Whilst not relevant for the example, it's another illustration of the way the URL is changed just before reaching your mod_rewrite rules.