[SOLVED] strange 'REQUEST_URI page load delay
Posted: Sun Apr 03, 2011 11:11 pm
I am getting a strange 'REQUEST_URI page load delay with the following code in my php file. when i go to http://www.example.com it take between 3 to 22 seconds to load the page. Yet when I go to http://www.example.com/index.php it load in about 1.5 seconds.
the code checks to see if site is at root. if it is then change it to root/index.php which in turn changes the url. the code would work great if it was not for the delay in the page load.
can i have an explanation as to why i might be seeing a delay with the code or an alternative to the code would be nice.
I have this code in the user module of my cms. how i am thinking it takes a few seconds to load the site before it gets to my code. then when the code is ran it loads the site up the second time which creates the delay. could this code do this?
the code checks to see if site is at root. if it is then change it to root/index.php which in turn changes the url. the code would work great if it was not for the delay in the page load.
can i have an explanation as to why i might be seeing a delay with the code or an alternative to the code would be nice.
I have this code in the user module of my cms. how i am thinking it takes a few seconds to load the site before it gets to my code. then when the code is ran it loads the site up the second time which creates the delay. could this code do this?
Code: Select all
if ($_SERVER['REQUEST_URI'] == "/") {
header("Location: ./index.php");
}