How Do I Use Php In My 404 Error Page For My Site?
I want to use php, but it looks as though I can only save error pages as .shtml documents. Please help. Thanks.
Related posts:
- How Do I Get My Own Error Message On Php? I have a php script. There is a variable which...
- How Do You Put Php Includes Into A Wordpress Site? I created php includes references for the left and right...
- Is There Any Way To Include Php Includes Inside An Html Page? I can’t use php pages cause it’s messing with my...
- How To Change My Php Site To A Secure Site? I’ve already made a web site using PHP, but now...
- How Do I Build A Redirect From An Asp Site To A Php Site? My company switched from an asp site to a php...
Related posts brought to you by Yet Another Related Posts Plugin.


September 4th, 2009 at 11:27 pm
As angela said, if you are using Apache as the server, you can just create the file “.htaccess” in the root directory of the website.
Put this in the file:
ErrorDocument 404 /404page.php
Create the 404page.php in the root directory of the site.
The page requested will be in the variable $REDIRECT_URL
September 4th, 2009 at 11:27 pm
Well, on my Windows XP Pro I’ve created folder c:inetpubwwwroottest, created application in IIS management console, set 404 error page to /test/404.php and created file:
< ?php
header('HTTP/1.1 404 Not Found');
echo "test";
Then open http://localhost/test/asdf and get “test” content.
Firebug says that it is 404.
My FastCGI INI:
[Types]
php = PHP-5.2
[PHP-5.2]
ExePath = C:WITSuiteLanguagesPHP-5.2php-cgi.ex…
Arguments = -c C:WITSuiteConfigurationIISPHP-5.2ph…
QueueLength = 999
MaxInstances = 20
InstanceMaxRequests = 500
ActivityTimeout = 600
ResponseBufferLimit = 0
September 4th, 2009 at 11:27 pm
To set up a custom error page on an Apache server, you need to be able to edit your .htaccess file. I have never heard of a requirement that it be an .shtml file. None of mine are. Most of mine are .html. a couple are .php.
I suppose that might depend on your host. http://www.pageresource.com/zine/custom4…