For some reason, my site lags when it runs "www.website.com", but loads just fine when it runs "www.website.com/index.php"
Is there a way that I can tell if the URL has the "index.php" in it or not?
I've tried to use the predefined variables REQUEST_URI, SCRIPT_NAME, SCRIPT_FILENAME, and PHP_SELF when I'm on "www.website.com/", but all of these return an index.php in the variable.
The goal that I'm trying to achieve is that if PHP can recognize "www.website.com/", I want to use headers to make it go to "www.website.com/index.php"
Any help on this would be greatly appreciated.
Thanks.
Echo the difference between '/' and '/index.php'
Moderator: General Moderators
Echo the difference between '/' and '/index.php'
Last edited by elHelgo on Tue Jul 31, 2007 10:25 am, edited 3 times in total.
The webserver sounds like it's been set up to make "index.php" a default index page. Webservers can't display "/" - they need a file to show. So, in this instance, the server is showing "index.php".
I'm with ~Begby - try and figure out why "/" is slow but "/index.php" is not slow. If it's a consistent problem, I'd check the configuration of the server software (I'm guessing Apache?)
I'm with ~Begby - try and figure out why "/" is slow but "/index.php" is not slow. If it's a consistent problem, I'd check the configuration of the server software (I'm guessing Apache?)
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
I know that there is something wrong with the host and/or server, but I was trying to find a quick fix for the problem. I did find one through trial and error, and was wrong about the REQUEST_URI output.
Simply enough, I just did this:
Hopefully this will buy me enough time to debug my other problems in life.
Simply enough, I just did this:
Code: Select all
if ($_SERVER['REQUEST_URI']=="/"){
header("Location: newsite.com");
}