PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, July 2, 2022

[FIXED] How to point to project index page by default in XAMPP

 July 02, 2022     php, web, xampp     No comments   

Issue

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


Solution

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.



Answered By - akinuri
Answer Checked By - David Goodson (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing