3
我正在嘗試讓Wordpress 3.3.1多站點(子域)在我的本地主機上工作。但是,似乎我需要爲我的Wordpress虛擬主機配置通配符子域。這個想法是有any_subdomain.my_wordpress.local去my_wordpress.local。Mac OS Lion - 通配符子域名虛擬主機
如何在帶有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 [email protected]
# 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
我還添加wordpress_mu到/ etc/hosts中。
127.0.0.1 wordpress_mu
在此先感謝您。
謝謝隊友。我會嘗試dnsmasq。 – bananaaus 2012-03-05 21:47:33
它的工作原理!謝謝。 :) – bananaaus 2012-03-06 05:28:58