Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Puzzling PHP problem

Status
Not open for further replies.

Kerflumper

IS-IT--Management
Mar 1, 2010
28
0
0
US
I have a perplexing problem with a PHP script running on a GoDaddy server. There is nothing special about the script, but the script will not run unless there is a file in the root of the web site called default.php. This default.php has no content except the following (the default page is presently index.html):

Code:
<script language=" php" >
if (getenv ("HTTP_HOST")=="[URL unfurl="true"]www.domain.com"[/URL] or
getenv ("HTTP_HOST")=="domain.com")
{
Header("Location: [URL unfurl="true"]http://www.domain.com/index.save");[/URL]
exit;
}
</script>

If I delete this file, the other script won't run. it might be worth mentioning that there is no index.save file anywhere.

What might be the cause of this?
 
Is the other file including this one somewhere? Or using it somehow?

When you say it doesn't run, do you get errors? A blank page?

Have you checked the error logs.

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
it looks as though there is a file called index.save that does all the lifting on your site. default.php will be set as a default file in apache, so anything that does not have an explicit uri will default to default.php. and from there, if the host name is correct, it will be forwarded to index.save. if the domain is something else then seemingly nothing happens and the script terminates loading naturally, unless you have not shown us the full text of the script

if it 'does not run' then I suspect you are not pointing your browser at index.save or you will need to show us the code within index.save and the results of a call to phpinfo().

 
As I mentioned above, index.save does not exist - never has. I did some more testing and if I delete the default.php and then wait an hour, everything works. There must be something odd with GoDaddy's server.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top