PHP URL display question.

Programming
Tutor: None Selected Time limit: 3 Days

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!

Nov 30th, -0001

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

Jun 12th, 2013

btw, you need to restart your server once your done. :-)

Jun 12th, 2013

hmmhm, I do not want to change my webroot. let's say I have my index.php on localhost, I want to make a link on index.php that would route me to my login page and display "http://localhost/index.php?r=site/login" as my URL. :)

Jun 12th, 2013

Oh so you only want to change this sepefic link. Are you using any PHP framework?  I can definitely help you :-)

Jun 12th, 2013

Are you studying on the go? Check out our FREE app and post questions on the fly!
Download on the
App Store
...
Nov 30th, -0001
...
Nov 30th, -0001
Dec 11th, 2016
check_circle
Mark as Final Answer
check_circle
Unmark as Final Answer
check_circle
Final Answer

Secure Information

Content will be erased after question is completed.

check_circle
Final Answer