我正在使用虚拟主机。我创建了一个_wordpress.conf文件:
# WordPress
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
...并将其包含在我的vhosts.conf
中<VirtualHost *:80>
ServerName example.org
DocumentRoot /var/www/example.org
<Directory /var/www/example.org>
Include _wordpress.conf
</Directory>
</VirtualHost>
配置仅适用于Directory标记。我想简化这种配置,如:
# _wordpress.conf
<Directory %{DOCUMENT_ROOT}>
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</Directory>
和...
# vhosts.conf
<VirtualHost *:80>
ServerName example.org
DocumentRoot /var/www/example.org
Include _wordpress.conf
</VirtualHost>
有可能吗?我已经尝试过很多但没有成功...... = /