Page 2 of 2

Posted: Thu Aug 21, 2008 10:14 pm
by konus
It looks like

Code: Select all

RewriteEngine Off 
ErrorDocument 404 /test/notfound.php
And I get the nice "Bla!" :? (you can check this by yourself by calling a unknown page within the directory, like http: //www.dd4kids.de/test/test.html

Posted: Fri Aug 22, 2008 10:14 am
by garvinhicking
Hi!

Probier mal folgende notfound.php:

Code: Select all

header('HTTP/1.0 200');
header('HTTP/1.0 404 Not Found');
header('HTTP/1.0 200');
header('Status: 200 OK');
header('Status: 404 Not Found');
header('Status: 200 OK');
echo "Bla!";
Grüße,
Garvin

Posted: Fri Aug 22, 2008 10:47 am
by konus
Ok, this was helpful. Now 404 is gone and Websniffer shows 200 :lol:
It looks like, header('Status: 200 OK'); did the trick.

Just curious: why do we need three lines with 200, 404 and 200 again. Why isn't it enough to send just one line with 200?

And what can we do with this knowledge now?

Posted: Fri Aug 22, 2008 11:42 am
by garvinhicking
Hi!

The three lines was just a test to see if multiple calls properly override each other.
And what can we do with this knowledge now?
We can patch the plugins and s9y. :)

You can find all calls to header('HTTP/1.0) in the plugins and s9y core files and replace them. I'll do that as well with the official versions:

http://svn.berlios.de/viewcvs/serendipi ... 6&view=rev

In the plugins I cannot easily give you a link, I just needed to modify about 20 or 30 plugins. Search in all of your PHP files for "HTTP/1" and then add an additional line:

Code: Select all

header('Status: 200 OK');
after those lines. Only modify those lines where you find a serendipity_header() or header() call before, not only the files where you might find other PHP commands sending headers.

Regards,
Garvin

Posted: Fri Aug 22, 2008 1:18 pm
by konus
OK, great!
In my case I had to edit serendipity_event_contactform.php and serendipity_event_staticpage.php.

Now I am happy and Google should be happy too! :lol: :lol: :lol:

I really like to thank you for the help!

Posted: Wed Dec 17, 2008 5:34 pm
by konus
Hi Garvin,
I just found another one: Could you please add

Code: Select all

header('Status: 200 OK');
to serendipity_event_contactform.php (in serendipity_event_contactform) below line 342 and comit it to SVN?

Thank you and
greetings from konus

Posted: Wed Dec 17, 2008 7:31 pm
by garvinhicking
Hi!

It's already there in the recent version of the plugin...

Regards,
Garvin

Posted: Thu Dec 18, 2008 12:03 am
by konus
OK thanks!