Rewrite Rule To Strip Certain Characters From URL
Hi! I am using the following rewrite rule in my .htaccess file:
RewriteRule ^search/node/(.*)$ custom-search&searchterms=$1 [NC,L]
The above works perfectly for my purposes, except for when special characters are entered (such as a double quote), as this causes a forbidden error. What I would like to do is strip out all characters except for letters, numbers and spaces from the $1 variable so that such errors are no longer an issue, and have been unable to do so. Can anyone tell me how this can be done? I want any characters except for letters, numbers and spaces to be stripped from the $1 portion of the rewritten URL.
Thanks for any help you can provide!