404 and PHP

design

#1

I’ve created a custom pageNotFound page and pointed to it with my .htaccess file. It works fine on .htm pages, but fails on .php pages. I get “No input file specified.” This setup works okay on another site, hosted by another company. What can I do to fix this?
Thanks.

Stever


#2

You can solve this problem by adding a few parameters in your .htaccess.

Check the comments at
What’s the difference between PHP-CGI and PHP as an Apache module?


[color=#000000]DreamHost Promo Code[/color]: [color=#CC0000]Save $50[/color] with the promo code DREAMTEAM


#3

That seems to cover the topic, but I barely know what they are talking about. Does it mean that I should put only the following into my .htaccess file, as suggested by sykong?

RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteRule (.+) /404.html

Or, do I also need an ErrorDocument 404 statement?

Thanks.

Stever


#4

Basicly the RewriteCond sets the following conditions: if the directory doesn’t exist (!-d), or the file doesn’t exist (!-f) forward to 404.html.

I don’t think you need the ErrorDocument statement.


[color=#000000]DreamHost Promo Code[/color]: [color=#CC0000]Save $50[/color] with the promo code DREAMTEAM


#5

These lines of code seemed to work, without the ErrorDocument statement.

RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteRule (.+) /404.html

This seems to me to be something lots of people would need help with. I wish DreamHost would just spell it out somewhere, for us less-tech people.

Thanks for your help.

Stever


#6

I’m glad you brought this up, andabien, because I didn’t realize I had a problem, too. When I type in a false page, I get my error document fine…or so I thought. I just tried typing in http://www.sassydevil.com/blue.php, and I get the “No input file specified” error. But those lines of code didn’t work for me, and I tried a few different things. My error document is 404.php, so I tried that, among other things.

But I should also point out, I’m using WordPress, so I have a large number of RewriteRule settings. After those settings, I have this:

END WordPress

ErrorDocument 404 /index.php?error=404
ErrorDocument 403 /index.php?error=403
Options All -Indexes

Anyone know what I need to do? Thanks.

Jen
http://www.SassyDevil.com/