如何在XAMPP中默认指向项目索引页 [英] How to point to project index page by default in XAMPP

查看:29
本文介绍了如何在XAMPP中默认指向项目索引页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对这种工作很陌生.我使用 PHP 开发了一个 Web 应用程序.我正在使用 XAMPP 服务器.现在,当我点击 http://www.mywebsite.com/myproject 时,我得到了我的项目索引页.现在我看到的是,如果我输入 http://www.mywebsite.com 它应该显示 myproject 的索引页面.

i am pretty new this kind of work. I had developed a web app using PHP. i am using XAMPP Server. Now when i am hitting http://www.mywebsite.com/myproject i got my project index page. Now what i looking is if i enter http://www.mywebsite.com it should display myproject's index page.

我不确定这个术语叫什么.我不知道如何搜索此解决方案.

I am not sure what is this term called. I didn't know how to search for this solution.

如果您能提供我应该寻找的术语或解决方案,我们将不胜感激.

Your help will be much appreciated if you can provide the term i should look for or the solution for this.

谢谢

推荐答案

当您编辑 httpd-vhosts.conf 文件(位于 C:\xampp\apache\conf\extra),相应地编辑 DocumentRoot 属性.

When you edit the httpd-vhosts.conf file (which is in C:\xampp\apache\conf\extra), edit the DocumentRoot property accordingly.

您当前的设置可能如下所示:

Your current settings are probably looking like this:

<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs"
    ServerName www.mywebsite.com
</VirtualHost>

它会将您定向到主 htdocs 文件夹.为了显示您的项目,您可以使用 www.mywebsite.com/myproject.您应该更改 DocumentRoot.例如:

which directs you to the main htdocs folder. In order to display your project, you use www.mywebsite.com/myproject. You should change the DocumentRoot. For example:

<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs/your-project-folder"
    ServerName www.mywebsite.com
</VirtualHost>

在 Win 8.1 Pro x64、XAMPP 5.6.21 便携版上测试.它正在工作.

Tested on Win 8.1 Pro x64, XAMPP 5.6.21 portable. It's working.

这篇关于如何在XAMPP中默认指向项目索引页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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