我正在尝试让Wordpress 3.3.1多站点(子域)在我的localhost中运行。但是,似乎我需要为我的Wordpress vhost配置通配符子域。我们的想法是让 any_subdomain.my_wordpress.local 转到 my_wordpress.local 。
如何在Mac OS 10.7.3中使用Apache 2.2.22执行此操作?
这是在我的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
提前谢谢。