我正在尝试让 Wordpress 3.3.1 多站点(子域)在我的本地主机中工作。但是,看来我需要为我的 Wordpress 虚拟主机配置通配符子域。这个想法是让any_subdomain.my_wordpress.local去my_wordpress.local。
如何在带有 Apache 2.2.22 的 Mac OS 10.7.3 中执行此操作?
这是在我的 http-vhosts.conf 文件中为该本地站点设置的虚拟主机:
<VirtualHost *:80>
DocumentRoot "/Users/some_user/Sites/wordpress_mu"
ServerName wordpress_mu
ServerAlias *.wordpress_mu
ServerAdmin some@email.com
# Logging
ErrorLog "logs/wordpress_mu.error_log.log"
CustomLog "logs/wordpress_mu.access_log.log" combined
<Directory "/Users/some_user/Sites/wordpress_mu">
RewriteEngine On
# To allow permalink as specified by wordpress admin interface
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
Options FollowSymLinks MultiViews Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
# Set valid directory pages
DirectoryIndex index.html index.htm index.shtml index.php
我还在 /etc/hosts 中添加了 wordpress_mu。
127.0.0.1 wordpress_mu
先感谢您。