Apache虚拟主机配置及WordPress固定连接设置
一.虚拟主机配置
首先去除httpd.conf文件下默认的DocumentRoot和<Directory "XXX">配置,添加类似以下代码。
<Directory />Options FollowSymLinksAllowOverride All</Directory>NameVirtualHost 127.0.0.1:81<VirtualHost school.ruanko.com:81>ServerAdmin school.ruanko.comServerName school.ruanko.comServerAlias school.ruanko.comErrorLog "logs/wplatest.com-error.log"CustomLog "logs/wplatest.com-access.log" combinedDocumentRoot "F:/works/php/school"<Directory "F:/works/php/school"> Options Indexes FollowSymLinks AllowOverride all Order allow,deny Allow from all</Directory></VirtualHost><VirtualHost note.dreamworker.org:81>ServerAdmin note.dreamworker.orgServerName note.dreamworker.orgServerAlias note.dreamworker.orgErrorLog "logs/wpstable.com-error.log"CustomLog "logs/wpstable.com-access.log" combinedDocumentRoot "F:/works/php/note"<Directory "F:/works/php/note"> Options Indexes FollowSymLinks AllowOverride all Order allow,deny Allow from all</Directory></VirtualHost>?
二.固定链接配置
首先要在WordPress中设置固定链接的样式,再来修改Apache的配置以支持URL重写。
修改httpd.conf文件,去除LoadModule rewrite_module modules/mod_rewrite.so前面的注释。然后记得吧<Directory>标签内的AllowOverride属性设置为All(本文前面的代码已经设置过了)。
?