Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to point to project index page by default in XAMPP

Tags:

php

web

xampp

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

like image 225
user2350138 Avatar asked Nov 04 '25 21:11

user2350138


2 Answers

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.

like image 169
akinuri Avatar answered Nov 06 '25 13:11

akinuri


  1. Open the file index.php from the htdocs in xammp ( ..\xampp\htdocs\index.php)

  2. Change the line

header('Location: '.$uri.'/dashboard/');

to

header('Location: '.$uri.'/yoursitefolder/');

this will resolve the issue.

like image 44
Abel Negash Avatar answered Nov 06 '25 14:11

Abel Negash



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!