How to point to project index page by default in XAMPP

两盒软妹~` 提交于 2019-12-08 04:20:14

问题


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.

thanks


回答1:


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>

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>

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



来源:https://stackoverflow.com/questions/38362369/how-to-point-to-project-index-page-by-default-in-xampp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!