...

View Full Version : Rewrite Rule To Strip Certain Characters From URL



IncrediBody.com
02-19-2011, 06:57 AM
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!

IncrediBody.com
02-24-2011, 09:31 AM
Any ideas?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum