Well…
I use subj to replace 404 error for my own page with content.
And Browsers work exellent with it, but if I want read headers from my site, I get this:
HTTP/1.1 302 Found
Date: Wed, 15 Jan 2003 12:52:40 GMT
Server: Apache/1.3.20 (Unix) mod_watch/3.12 mod_deflate/1.0.7 AuthMySQL/2.20 PHP/4.2.3 rus/PL30.5
And html source of hoster’s error page…
I want the programm I read headers get RIGHT content(my) , not “302 error”.
It’s important for me, because www=>mail robots don’t see my page too.
If you know how to solve this problem, help me!
pippo
January 16, 2003, 8:33am
2
Hi,
you need to use:
<?php
header( "HTTP/1.1 200 OK" ); // <<-- this is the trick :-)
//etc etc
?>
check this:
http://www.sitepointforums.com/showthread.php?s=&threadid=76755&highlight=200
Not sure that was what you need…
Re-reading better your post…who’s subj ?
pippo
Well…
My page CHANGE 404 error to my content for browsers, not programms, reading headers.
You see, My visitor gets I want. But If I use programm to read headers from server it returns 302 error.
When I’ve written “SUBJ”, I mean
header( "HTTP/1.1 200 OK" );
Yes, My site uses errordocument in .htaccess and
header( "HTTP/1.1 200 OK" );
in the script!
But… It doesn’t work for programs, reading headers.
That’s the problem…
;-(
pippo
January 16, 2003, 10:33am
4
How did you set the ErrorDocument directive ?
It should be
ErrorDocument 404 /pippo.php
and not
ErrorDocument 404 http_://www_etc_com/pippo.php
My .htaccess is:
ErrorDocument 302 /se.php
ErrorDocument 401 /se.php
ErrorDocument 403 /se.php
ErrorDocument 404 /se.php
ErrorDocument 500 /se.php
DirectoryIndex /read.php
pippo
January 16, 2003, 12:12pm
6
I tried this:
/404.php
<?php
header( “HTTP/1.1 200 OK” );
?>
/.htaccess
ErrorDocument 302 /404.php
ErrorDocument 404 /404.php
RewriteEngine On
RewriteRule ^(superpippo)/?$ /index.php [R] <<– force a 302
the with a telnet I tried this:
GET /foo_page.htm HTTP/1.1
Host: www.mytest.net
I got a 200 OK
and with
GET /superpippo HTTP/1.1
Host: www.mytest.net
I got a 200 OK
so I don’t understand why you got that.
What’s that:
RewriteEngine On
RewriteRule ^(superpippo)/?$ /index.php [R] <<– force a 302
???
Mod_Rewrite?
What Have I change that for exellent working of script?
What rule I have to write?
Perhaps, some tutorial?
pippo
January 16, 2003, 7:06pm
8
Ahem,
I used the rewrite rules only to simulate a 302 status code.
I used it to verify that the 404.php was called when a 302 is issued.
What’s the page that generate a 302 ?
pippo
Yeah, I see.
Reget returns it:
Input 5 13:34:32 16.1.2003 HTTP/1.1 404 Not Found
Input 5 Date: Thu, 16 Jan 2003 10:35:26 GMT
Input 5 Server: Apache/1.3.20 (Unix) mod_watch/3.12 mod_deflate/1.0.7 AuthMySQL/2.20 PHP/4.2.3 rus/PL30.5
Input 5 X-Powered-By: PHP/4.2.3
Input 5 status: 200 OK
Input 5 Connection: close
Input 5 Content-Type: text/html; charset=windows-1251
Input 5 Expires: Thu, 01 Jan 1970 00:00:01 GMT
Input 5 Last-Modified: Thu, 16 Jan 2003 10:35:26 GMT
NOT 302…
status: 200 OK - perhaps is header in php-script.
Need url to check it?
What can you say about it?
pippo
January 21, 2003, 6:47am
11
Oh, I’m sorry didn’t notice the answer.
>> Need url to check it?
Yup, please pm it to me.
Thanks,
pippo