在 apache htaccess 中搜索并替换一个 RewriteRule [英] Search and replace in apache htaccess a RewriteRule

查看:21
本文介绍了在 apache htaccess 中搜索并替换一个 RewriteRule的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我基本上想得到

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

重写为

/path/file name with plusses.mp3

就我而言,wordpress 正在拦截请求并给出 404.但该文件确实存在.

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

考虑到 mod_rewrite 实现中正则表达式的限制,我还没有看到一种直接的方法.

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

推荐答案

试试这个规则:

RewriteRule ^([^+]*)\+(.*) $1\ $2 [N]

这篇关于在 apache htaccess 中搜索并替换一个 RewriteRule的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆