so my index.php can be this:
<?php
$restOfURL = ''; //idk how to get this
print $restOfURL; //this should print 'FOO', 'VAR3', or any string after the domain.
?>
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Reading
$_SERVER['REQUEST_URI'], as everybody has pointed out, can tell you what the URL looks like, but it doesn’t really work the way you want it unless you have a way to point requests forme.com/VALUE1andme.com/VALUE2to the script that will do the processing. (Otherwise your server will return a 404 error unless you have a script for each value you want, in which case the script already knows the value…)Assuming you’re using apache, you want to use mod_rewrite. You’ll have to install and enable the module and then add some directives to your .htaccess, httpd.conf or virtual host config. This allows you make a request for
me.com/XXXmap internally tome.com/index.php?var=XXX, so you can read the value from$_GET['var'].