Click to See Complete Forum and Search --> : Where is error??


Taurus
03-22-2003, 12:52 PM
The web server contain 3 files(this is an example):
1) folder "cgi", placed in server by default ( I not use it)
2)folder "folder"(I put file.pdf in this folder)
3)index.php -page that contain the php code.

When I try open http://domain.com, I get message: ERROR 404 PAGE NOT FOUND
The http://domain.com/folder/ opens normally, but http://domain.com/folder/file.pdf - gives error:ERROR 404 PAGE NOT FOUND
What is wrong? How do need place file correct?

jdavia
03-22-2003, 01:24 PM
Originally posted by Taurus
The web server contain 3 files(this is an example):
1) folder "cgi", placed in server by default ( I not use it)
2)folder "folder"(I put file.pdf in this folder)
3)index.php -page that contain the php code.

When I try open http://domain.com, I get message: ERROR 404 PAGE NOT FOUND
The http://domain.com/folder/ opens normally, but http://domain.com/folder/file.pdf - gives error:ERROR 404 PAGE NOT FOUND
What is wrong? How do need place file correct?
Look at your code very carefully, you could have an error.

AdamGundry
03-23-2003, 02:37 PM
HTTP error 404 means the server could not find the page the browser requested. Here, it is probably occuring because your server is not set to use index.php as the default page when none is specified (i.e. the user enters http://domain.com).

You need to change your server setup to treat index.php as a default document - see your server documentation for instructions on how to do this. Alternatively, most servers use names like index.htm, index.html or default.htm for the default document, so try making your index page one of these extensions instead.

Adam

Taurus
03-24-2003, 10:06 AM
I use third party hosting. As I see from rules, the first page may be named as index.php:
"Your first page must be called one of the following: index.html... index.php, INDEX.PHP"

I use the following code(example), which I put in html page on the top(I delete ALL default content from html window in FrontPage2000 new page and place my code):

<?php
$file_url = "http://subdomain.com/folder/file.pdf";
header("Content-Type: application/pdf");
header("Content-Disposition: inline; filename="file.pdf"");
header("Location: $file_url");
?>

Now when I type url http://subdomain.com I just see empty page(with no error message). When I type http://subdomain.com/folder/file.pdf the file opens normal.

Taurus