Problem with static pages

Found a bug? Tell us!!
konus
Regular
Posts: 334
Joined: Mon Jun 16, 2008 1:57 pm
Location: Dresden, Germany
Contact:

Post 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
Last edited by konus on Tue Nov 04, 2008 11:28 pm, edited 1 time in total.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
konus
Regular
Posts: 334
Joined: Mon Jun 16, 2008 1:57 pm
Location: Dresden, Germany
Contact:

Post 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?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
konus
Regular
Posts: 334
Joined: Mon Jun 16, 2008 1:57 pm
Location: Dresden, Germany
Contact:

Post 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!
konus
Regular
Posts: 334
Joined: Mon Jun 16, 2008 1:57 pm
Location: Dresden, Germany
Contact:

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

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

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
konus
Regular
Posts: 334
Joined: Mon Jun 16, 2008 1:57 pm
Location: Dresden, Germany
Contact:

Post by konus »

OK thanks!
Post Reply