mod-substitute apache中的多行代码
问题描述:
我需要在httpd.conf中进行多行替换。我曾尝试使用mod_substitue并且\n
似乎不适用于它。mod-substitute apache中的多行代码
例如,更换:
<head>
有:
<head>
<script>
//about 20 lines of scripts
</script>
有没有办法在Apache的2.4做到这一点?
答
可以使用反斜杠“\”作为 的最后一个字符,表示该指令继续到下一行。必须有 不是其他字符或反斜杠和 行之间的空格。 *
Substitute "s|<head>|<head>\
Line 1\
Line 2\
...\|ni"