tags:

views:

117

answers:

2

I cant open .doc files from my browser on my website (php)

rather my 404 page, opens

could it be my htaccess setings?

+1  A: 

You recieve a 404 because the URL you are using is not correct.

Make sure the URL is exactly right, the file exists in the place you expect and the permissions are correct on the web server.

Jon Winstanley
A: 

Following on from Jon Winstanley's answer:

You can use the file_exists and is_readable functions to help you diagnose the cause of the problem. eg.

if (!file_exists('path/to/file/filename')) {
    die("Couldn't find the file, my path is wrong");
}
if (!is_readable('path/to/file/filename')) {
    die("Couldn't read the file, my permissions are wrong");
}
Blair McMillan
is_readable is something most people usually forget
Jon Winstanley