You have the entire recipe there. I would change the first line from 404.htm to 404.php, but that’s about it. The ErrorDocument part just goes by itself on a single line in the .htaccess file, and the PHP part is just as it is here, but don’t put the backslashes in before the quotes, they negate the quotes and your code won’t run.
I don’t understand why your admin used backslashes in an .htaccess
file, it doesn’t have to be there unless you are trying to actually
act on a filename with a quotation mark in it.
Also, you don’t need the thing in these list messages – adding
the four tildes on either side of the code is the same as writing
your code here
. For one or two word examples
inline, you can wrap a word or phrase with back-ticks foo() and get foo() back on the Web.
Walter
On Nov 25, 2009, at 11:04 AM, atelier wrote:
Thank you Walter
Here’s som additional information I got recently, maybe it explains
the back-slashes? ?
My own ISP wrote me that in his .htaccess is this code
php_flag session.use_trans_sid off
php_flag register_globals off
<Files ".ht*">
deny from all
</Files>
and in the server config is this:
<code>ErrorDocument 404 /404.htm</code>
Final question:
Do you mean that I should rename also the filename 404.htm to 404.php?
And should I write in the .htaccess file on this other server only
this (and rename the 404.htm to 404.php)
Here’s som additional information I got recently, maybe it explains
the back-slashes? ?
My own ISP wrote me that in his .htaccess is this code
php_flag session.use_trans_sid off
php_flag register_globals off
<Files ".ht*">
deny from all
</Files>
and in the server config is this:
<code>ErrorDocument 404 /404.htm</code>
Final question:
Do you mean that I should rename also the filename 404.htm to 404.php?
And should I write in the .htaccess file on this other server only
this (and rename the 404.htm to 404.php)
ErrorDocument 404 /404.php
I am not sure if you can set this in the .htaccess – by the time that
file is read, it may be too late. Try it, but be prepared to put it at
the httpd.conf level if it doesn’t work. Yes to the rename question.
Happy Thanksgiving to you too, Walter!
How I wish I could do something for you in return for all the good advise you have been giving all those numerous times. Really.