将域名指向运行XAMPP和wordpress的服务器ip [英] Pointing domain name to server ip running XAMPP and wordpress

查看:319
本文介绍了将域名指向运行XAMPP和wordpress的服务器ip的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的Windows服务器上安装了XAMPP,并安装了Wordpress XAMPP模块。我还买了一个域名指向我的服务器ip。事情是,我希望当人们进入mydomain.com时,mydomain.com会在地址栏中显示并且在浏览时会一直显示。

I installed XAMPP on my windows server and also installed Wordpress XAMPP module. I also bought a domain to point it to my server ip. Thing is , I want that when people enter mydomain.com , mydomain.com shows in the address bar and that it keeps showing while browsing.

首先我试图指出域到我的IP,当我去mydomain.com它显示mydomain.com/xampp

First I tried to point the domain to my ip , and when I go to mydomain.com it shows mydomain.com/xampp

然后我尝试更改: DocumentRootC :\ xampp \htdocs
< DirectoryC:\ xampp \\\\\\\\\\\\\\\\\\\\\\\ \ conf

Then I tried to changing:DocumentRoot "C:\xampp\htdocs" <Directory "C:\xampp\htdocs"> in httpd file in C:\xampp\apache\conf

DocumentRootC:\ xampp \ apps \ wordpress\htdocs
< DirectoryC:\ xampp \ apps \wordpress\htdocs>

但是这次当我进入mydomain.com时,它会重定向到myipaddress.com/wordpress

But this time when I enter mydomain.com it redirects to myipaddress.com/wordpress

我想要的只是:
1)当有人进入时mydomain.com,他会看到我的wordpress主页。
2)每当用户浏览mydomain.com时,他总会看到mydomain而不是myipaddress。

All I want is: 1)When someone enters mydomain.com , he will see my wordpress home page. 2)Whenever a user is browsing mydomain.com , he will always see mydomain instead of myipaddress.

任何帮助都将不胜感激。
问候!

Any help would be appreciated. Regards!

推荐答案

在httpd文件的底部输入:

Type this at the bottom of your httpd file:

Alias /wordpress "C:/xampp/htdocs/wordpress/"
<Directory "C:/xampp/htdocs/wordpress/">
AllowOverride All
Order allow,deny
Allow from all
</Directory>

请注意,我上面说的目录是默认目录的示例。我很难找到你的目录,但上面的例子应该有意义。在httpd文件上键入代码后,转到xamp / apache / conf / extra /目录并打开httpd-vhosts文件。在httpd-vhosts文件的底部输入:

Please take note that the directory that I stated above is a sample of a default directory. I am having a hard time trying to figure out your directory but the above example should make sense. After typing the codes on your httpd file, go to the directory of xamp/apache/conf/extra/ and openup the httpd-vhosts file. Type this at the bottom of the httpd-vhosts file:

NameVirtualHost *:80

<VirtualHost *:80>
ServerName www.yourdomain.com
ServerAlias yourdomain.com
ServerAdmin email@yourdomain.com
DocumentRoot "C:\xampp\htdocs\wordpress"
</VirtualHost>

如果您已输入此行,请仔细检查您的主机文件:

Double check your host file if you already entered this line:

127.0.0.1     yourdomain.com

重新启动Apache Web服务器。希望这有帮助!

Restart your Apache webserver. Hope this helps!

这篇关于将域名指向运行XAMPP和wordpress的服务器ip的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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