【问题标题】:Multiple htaccess statements on one line一行上有多个 htaccess 语句
【发布时间】:2016-08-10 02:15:15
【问题描述】:

是否可以在 Apache 的 .htaccess 文件中的一行上编写两个或多个语句。例如

ErrorDocument 403 "test"
ErrorDocument 404 "test2"

如果结束语句字符是“;”,理想情况下会变成以下内容

ErrorDocument 403 "test";ErrorDocument 404 "test2"

这不是为了便于阅读,而是为了解析。

*更新我还尝试了以下可能帮助您跳出框框思考的方法:

<directory>ErrorDocument 403 "test"</directory><directory>ErrorDocument 404 "test2"</directory>

【问题讨论】:

标签: php apache .htaccess


【解决方案1】:

“不。” 这就是它的长短。 Apache 要求您在出于某种原因似乎打算使用分号的情况下使用“换行符”。

【讨论】:

    猜你喜欢
    • 2020-02-09
    • 1970-01-01
    • 2012-06-09
    • 2023-03-16
    • 2013-02-28
    • 1970-01-01
    • 2012-07-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多