编辑我的 local-development.conf 文件,我可以使用Dropbox而不是Google云端硬盘(因为我认为文件夹名称中有空格)。
<Directory "/Users/myusername/Google Drive/CODE PROJECTS/vhosts/">
AllowOverride All
</Directory>
# Named Virtual Host
LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon
CustomLog /Users/myusername/Google Drive/CODE PROJECTS/logs/access.log vcommon
ErrorLog /Users/myusername/Google Drive/CODE PROJECTS/logs/errors.log
UseCanonicalName Off
VirtualDocumentRoot /Users/myusername/Google Drive/CODE PROJECTS/vhosts/%0
我试过逃避:
CustomLog /Users/myusername/Google\ Drive/CODE\ PROJECTS/logs/access.log vcommon
ErrorLog /Users/myusername/Google\ Drive/CODE\ PROJECTS/logs/errors.log
UseCanonicalName Off
VirtualDocumentRoot /Users/myusername/Google\ Drive/CODE\ PROJECTS/vhosts/%0
错误日志告诉我&#34; Google \&#34;不是文件。
所以我试了一下引号,确保它们不是卷曲引号:
CustomLog "/Users/myusername/Google Drive/CODE PROJECTS/logs/access.log" vcommon
ErrorLog "/Users/myusername/Google Drive/CODE PROJECTS/logs/errors.log"
UseCanonicalName Off
VirtualDocumentRoot "/Users/myusername/Google Drive/CODE PROJECTS/vhosts/"%0
我尝试在我的Mac上为这两个文件夹创建一个别名,但这并没有解决问题。
显然,重命名Google云端硬盘文件夹不是一个选项,我也希望保留其他文件夹名称。
答案 0 :(得分:0)
解决方案是在引号中包含%0变量。
<Directory "/Users/myusername/Google Drive/CODE PROJECTS/vhosts/">
AllowOverride All
</Directory>
# Named Virtual Host
LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon
CustomLog "/Users/myusername/Google Drive/CODE PROJECTS/logs/access.log" vcommon
ErrorLog "/Users/myusername/Google Drive/CODE PROJECTS/logs/errors.log"
UseCanonicalName Off
VirtualDocumentRoot "/Users/myusername/Google Drive/CODE PROJECTS/vhosts/%0"