views:

173

answers:

2

I am running IIS7 and for the longest time I have been dealing with only being able load index.php. All other requested files return a "File not found" type message in the browser. I have built my own OOP Framework making it mostly a non issue. Now I am doing some ajax stuff. Ajax REQUIRES that I make use of more then one file because if I just used the index file to get data it would also run ALL of the other code in index.php. Because I am using a Framework, logic to only run selected part of index.php at a time is NOT POSSIBLE. I even went so far as to use an old "content switcher" I wrote a while ago. Basically you choose the file to be loaded like so: localhost/site/index.php?page=test. This does not work. Not only do I find this aggravating Ii find it curious that IIS will let me include my registry class in index.php but no let me include test.php. The browser returns this message: "File not found". Test.php does exists. When i type a random non existent file name the error handler in my "content switcher" throws its own custom error: "File does not exists". If I didn't know any better I would say IIS is f***ing with my mind.

So whats the god am f**king deal? And how to fix it?

Excuse my use of expletives but after 2 days of strait coding (6 hours of sleep) and then sitting on your ass for 7 hours making no progress can really get to you.

After all this time I still manage to run into the weirdest s**t while coding. At this rate I may become the worst programmer of all time, but the best debugger.

+1  A: 

This sounds like an IIS config issue, and as such you may get better responses at serverfault.com.

Is it only PHP files that can't be found, or if you create test.html does that also return 404s?

Have you checked the file permissions for the new files you create? Security and sharing setting?s

Are there any HTTP Redirects setup for the domain in question?

Rob Drimmie
A: 

After nearly 10 hours I figured it out. At least one of the reasons IIS7 is returning 404's. Keep in mind this is very odd possibly a bug. The PHP code at fault: $foo = $_GET['bar'];. This will cause the 404 only if there is no value supplied in the address bar for 'bar'. Like I said this behavior is dumb and does not effect index or default files.

I can't log back in but if a mod can give Rob Drimmie credit for the 'answer' because his suggestion helped me arrive at my solution.

Thanks so much Rob.