使用Apache虚拟主机时Wordpress无法正常工作 [英] Wordpress not working when using Apache virtual hosts

查看:156
本文介绍了使用Apache虚拟主机时Wordpress无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前在计算机上使用虚拟主机,以便可以管理计算机上的多个站点.

I currently use virtual hosts on my computer so that I can manage multiple sites on my computer.

当前,我使用 c:/vhosts/php (默认本地主机)进行常规的PHP开发,使用 c:/vhosts/BTS 进行Wordpress,并使用 c :/vhosts/cake 用于CakePHP开发. (请参见下文).

Currently, I use c:/vhosts/php (default localhost) for regular PHP development, c:/vhosts/BTS for Wordpress, and c:/vhosts/cake for CakePHP development. (see below).

现在,当我启动WAMPP并转到 http://BTS 时,它将加载索引页,但没有其他加载项.尝试单击链接时,它链接到 http://localhost/xxxxx 而不是

Now when I launch my WAMPP and go to http://BTS, it loads the index page but nothing else loads fine. When trying to click on the links, it links to http://localhost/xxxxx instead of http://BTS/xxxxx. What am I missing here? I don't want the server to access localhost since I'm using localhost for other projects. Please help.

<VirtualHost *:80>
DocumentRoot c:/vhosts/php
ServerName localhost
</VirtualHost>

<VirtualHost *:80>
DocumentRoot c:/vhosts/BTS
ServerName BTS
</VirtualHost>

<VirtualHost *:80>
DocumentRoot c:/vhosts/cake
ServerName cake
</VirtualHost>

推荐答案

进入您的MySQL数据库(通过phpmyadmin或其他方式)并查找以下字段

Go into your MySQL database (thru phpmyadmin or whatever) and look for the following fields

在wp_options表中,更改

In the wp_options table, change

siteurl
home

代替代替 http://BTS .

这将更新您在wordpress中的所有链接.

This will update all your links in wordpress.

这篇关于使用Apache虚拟主机时Wordpress无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆