【发布时间】:2014-03-24 03:43:07
【问题描述】:
我用 xampp 和 bitnami 在 Windows 7 机器上安装 wordpress。
默认是http://127.0.0.1/wordpress
如何将其更改为不带页面前缀的标准主机名(如http://myworpdress)
【问题讨论】:
标签: php wordpress apache xampp bitnami
我用 xampp 和 bitnami 在 Windows 7 机器上安装 wordpress。
默认是http://127.0.0.1/wordpress
如何将其更改为不带页面前缀的标准主机名(如http://myworpdress)
【问题讨论】:
标签: php wordpress apache xampp bitnami
Bitnami WordPress 堆栈包含一个名为“bnconfig”的工具,可让您轻松解决此问题。所有内容都记录在 Bitnami 文档中,请查看以下链接:
【讨论】:
您必须在您的主机文件(C:\Windows\System32\Drivers\etc\hosts)中为您的域创建一个条目
127.0.0.1 mywordpress
此外,如果您要在本地机器上测试多个域,您可以在 apache 配置中添加虚拟主机
<VirtualHost *:80>
ServerName wordpress
DocumentRoot C:\yourpath\...
</VirtualHost>
vhost 配置位于 C:\xampp\apache\conf\extra\httpd-vhosts.conf 下。 NameVirtualHost 也应该在 vhosts.conf 文件中启用
NameVirtualHost 127.0.0.1
【讨论】:
另一种解决方案是创建别名。在这种情况下,您仍将引用 localhost,但您也可以在单个服务器上永久拥有多个并行网站,并在文件系统上的任何位置定位它们。
例如:
在 apache httpd.conf 文件的 DocumentRoot 部分添加以下内容:
Alias /toenails/ "C:\projects\toenails/"
<Directory "C:\projects\toenails">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks Includes ExecCGI
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
Require all granted
</Directory>
【讨论】: