Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Search and replace in apache htaccess a RewriteRule

I'd basically like to get

/path/file+name+with+plusses.mp3

to rewrite to

/path/file name with plusses.mp3

In my case wordpress is intercepting the request and giving a 404. But the file does indeed exist.

Given the constraints of the regex in mod_rewrite implementation, I haven't yet seen a straightforward way of doing this.

like image 377
Paul Irish Avatar asked May 28 '09 05:05

Paul Irish


1 Answers

Try this rule:

RewriteRule ^([^+]*)\+(.*) $1\ $2 [N]
like image 136
Gumbo Avatar answered Sep 19 '22 12:09

Gumbo