我在wamp/bin/apache/apache2.4.17/conf/extra/httpd-vhosts.conf
文件,如下定义的VirtualHost
():在www.site.local
怎样才可以有一个点在我的WordPress URL上WAMP的虚拟主机在本地主机上
<VirtualHost *:80>
ServerName www.site.local
DocumentRoot h:/dev/wamp3/www/site
<Directory "h:/dev/wamp3/www/site">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
WordPress网站可当我访问主页。 但是,如果访问任何帖子或页面,该URL将变为http://localhost/site/post-name
,因为我预计URL为http://www.site.local/post-name
。
请提出建议。
这个问题是不是与虚拟主机,但你好像有什么事情,您重定向到本地主机。 – apokryfos
是的,在我的wp-admin中,我仍然使用'localhost'地址。 – theKing
如果安装到“http:// localhost/site/post-name”中,然后创建了虚拟主机,则已安装。 WP记得你用来安装它的网址。删除WP实例,并使用'www.site.local/install'重新安装它。 – RiggsFolly