-3

My site http://devoffpod.purplebottlemedia.com/ isn't pulling the index.html file when adding an empty index.php file to my server. As soon as I remove the index.php file from the server my site pulls correctly. Does any one have any suggestions to why this might be happening?

  • Yeah. It's supposed to be that way if you configure your webserver that way (or it came preconfigured). – Sergiu Paraschiv Sep 03 '13 at 15:55
  • Looks like the response is empty. In other words, you website finishes doing something but doesn't return anything back. – Serguei Fedorov Sep 03 '13 at 15:55
  • Is your server configured to run PHP Scripts ? What does show ? – Shankar Narayana Damodaran Sep 03 '13 at 15:56
  • @ShankarDamodaran I believe that would prompt the server to give the file to you as a download... – Serguei Fedorov Sep 03 '13 at 15:56
  • Suggestion: don't place an index.php file in your web root. – Sergiu Paraschiv Sep 03 '13 at 15:56
  • 1
    Returning an empty response is not the same thing as "crashing." If you put an empty index file on the server and you get back an empty response, then that means it's successfully serving the empty index file. If you don't want it to serve that file, don't put it there. – David Sep 03 '13 at 15:57
  • Try putting "Echo 'something'" at the top before anything happens. – Serguei Fedorov Sep 03 '13 at 15:57
  • I forget where, but in Apache's config, there's a setting that tells it which "index" files to load. Presumably, it has `php` before `html`. – gen_Eric Sep 03 '13 at 15:57
  • 1
    See [Why does index.html have priority over index.php?](http://stackoverflow.com/questions/7873634/why-does-index-html-have-priority-over-index-php) – Fabien TheSolution Sep 03 '13 at 15:57
  • Response header: ` Content-Length:0 Content-Type:text/html Server:Apache` So yeah. – Sergiu Paraschiv Sep 03 '13 at 15:58
  • @FabienTheSolution: That's what I was thinking of! :-D – gen_Eric Sep 03 '13 at 15:59
  • I want the file to be served for sure. I had originally added code to call if mobile display a mobile.html page. Adding that code worked and successfully redirected the site on mobile. It's just when using my desktop that it doesn't load. I tried putting the file in a sub folder but the problem I'm having when doing that is my site doesn't redirect on mobile. – Daniel McGinn Sep 03 '13 at 16:06
  • Would it note pull correctly if the site is being hosted on a sub domain? – Daniel McGinn Sep 03 '13 at 16:29

2 Answers2

5

Servers that support PHP are usually configured to look for an index.php before they look for an index.html.

You have an index.php so it is being served.

Servers don't check to see if an index file has any content before serving it.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
1

try to insert .htaccess (text file) in the principal directory

with this code at the inner

DirectoryIndex index.php index.html