Copied and pasted from
http://forums.digitalpoint.com/showthread.php?t=278494 (not my answer). In this instance, the request was to change ’+’ into ’_"
"You can do this in mod_rewrite but it’s not ideal. Unfortunately there is no such command to replace a certain character with another and therefore you’d need to create regex patterns for every number of + there may be in the URL. If you’re only ever expecting one +, you can use:
RewriteRule ^tag/(.+)\+(.+)$ tag/$1_$2 [R=301]
If there may be two +, you’d need another rewrite rule to match that as well:
RewriteRule ^tag/(.+)\+(.+)\+(.+)$ tag/$1_$2_$3 [R=301,L]
And so on. As I’m sure you can imagine, PHP would quickly become a better solution:
php Code:
if ( strpos($_SERVER[’REQUEST_URI’],’+’) ) {
header(’Location:
http://www.domain.com’ . str_replace(’+’,’_’,$_SERVER[’REQUEST_URI’]);
exit;
}
"
Not entirely sure where you’d do the PHP method, but the htaccess one should work.