我已经使用 Puphpet 设置了一个本地 VM。我的文件结构如下:
|-www
|- public
-.htaccess
- index.php
| -subdomain
-.htaccess
- index.php
以下是我的 config.yaml 中的相关位:
modules:
- rewrite
vhosts:
fj3ju1mwry6l:
servername: main.dev
serveraliases:
- www.main.dev
docroot: /var/www/public
port: '80'
setenv:
- 'APP_ENV dev'
directories:
zfy5qmype3xj:
provider: directory
path: /var/www/public
options:
- Indexes
- FollowSymlinks
- MultiViews
allow_override:
- All
require:
- all
- granted
custom_fragment: ''
engine: php
3xbo0zhpbo5g:
servername: subdomain.main.dev
docroot: /var/www/subdomain
port: '80'
directories:
otngayglj5ug:
provider: directory
path: ''
options:
- Indexes
- FollowSymlinks
- MultiViews
allow_override:
- All
require:
- all
- granted
custom_fragment: ''
engine: php
custom_fragment: ''
mod_pagespeed: 0
在我放置的每个 .htaccess 中:
deny from all
访问 main.dev 会导致禁止,这是正确的,但是访问 subdomain.main.dev 会显示 index.php。有人知道 .htaccess 被第二个虚拟主机忽略了吗?