0

在 htaccess 文件中是否可以使用相对路径?我正在寻找是否存在使用相对路径的任何方式,所以我不会在新服务器上更改它们

AuthUserFile {WEBSPACEROOT} auth/.password
AuthGroupFile {WEBSPACEROOT} auth/.group

AuthName "Reserved Area"
AuthType Basic

WEBSPACEROOT 是我的网络服务器根

4

1 回答 1

0

是的,你可以,我不推荐它。它们必须与 apache 文档中定义为的 ServerRoot 相关

The ServerRoot directive sets the directory in which the server lives. Typically it will contain the subdirectories conf/ and logs/. 
Relative paths in other configuration directives (such as Include or LoadModule, for example) are taken as relative to this directory.

你有什么理由要求他们是相对的吗?如果您使用完整路径,会更容易理解。

于 2013-09-04T15:58:04.980 回答