PHP URL display question.

User Generated

nqmnlxb

Programming

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!

User generated content is uploaded by users for the purposes of learning and should be used following 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


Anonymous
Super useful! Studypool never disappoints.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags