带有xampp的Windows上的Wordpress如何更改默认URL

时间:2014-02-22 12:47:40

标签: php wordpress apache xampp bitnami

我使用xampp和bitnami在Windows 7机器上安装wordpress。

默认情况下,网址为http://127.0.0.1/wordpress

如何在没有页面前缀的情况下将其更改为某个标准主机名(如http://myworpdress

3 个答案:

答案 0 :(得分:1)

Bitnami WordPress堆栈包含一个名为" bnconfig"这使您可以轻松解决此问题。 Bitnami文档中记录了所有内容,请查看以下链接:

https://docs.bitnami.com/installer/apps/wordpress/#how-to-configure-the-application-to-run-at-the-root-url-of-the-domain

答案 1 :(得分:0)

您必须在您的域的主机文件(C:\ Windows \ System32 \ Drivers \ etc \ hosts)中创建一个条目

127.0.0.1    mywordpress

此外,如果要在本地计算机上测试多个域,可以在apache配置中添加vhosts

<VirtualHost *:80>
    ServerName wordpress

    DocumentRoot C:\yourpath\...
</VirtualHost>

vhost配置位于C:\ xampp \ apache \ conf \ extra \ httpd-vhosts.conf下。还应在vhosts.conf文件中启用NameVirtualHost

NameVirtualHost 127.0.0.1

答案 2 :(得分:0)

另一种解决方案是创建别名。在这种情况下,您仍然会引用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>