PHP URL display question.

User Generated

nqmnlxb

Programming

Question Description

How can I write a simple PHP script that would display "http://localhost/index.php?r=site/login" instead of "http://localhost/myfolder/anotherfolder/login.php"? Please help..

Thanks a lot!

Student has agreed that all tutoring, explanations, and answers provided by the tutor will be used to help in the learning process and in accordance with Studypool's honor code & terms of service.

Explanation & Answer

Hi, you have to change your webroot in the httpd.conf file. Are you using Apache? If so, let me know if you are using EC2 or other service. You need to find the file called "httpd.conf" in your server.

Search webroot in the file. Change it from

/var/www/html

to 

/var/www/html/myfolder

urael (1070)
University of Virginia

Anonymous
Super useful! Studypool never disappoints.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4