Discussions
Activity
Sign In
How it works
Newscoop Support
404.tpl gives HTTP 200 OK, although header('404')
Vote Up
0
Vote Down
BAUMANN Thomas
July 2012
Posts: 45
Member
Hi,
I want to ensure the 404.tpl Pages being sent to Browser with corrent HTTP Error Code.
Therefore I did following:
//file: 404.tpl//
{{ include file="_tpl/_html-head404.tpl" }}
<body id="sectionpage">
<div id="container">
...
//file tpl__html-head404.tpl //
{{php}}
header('HTTP/1.0 404 Not Found');
{{/php}}
{{ include file="_tpl/_html-head.tpl" }}
But when performing a wget -S there a HTTP 200 is given instead of a HTTP 404.
wget -S
http://x253.rz14.tiri.li/xxxx
-O - 2>&1
--2012-07-09 20:49:23--
http://www.tiri.li/xxxx
Resolving www.tiri.li (www.tiri.li)... 127.0.1.1
Connecting to www.tiri.li (www.tiri.li)|127.0.1.1|:80... connected.
HTTP request sent, awaiting response...
HTTP/1.1 200 OK
Date: Mon, 09 Jul 2012 18:49:23 GMT
Server: Apache/2.2.22 (Ubuntu)
X-Powered-By: PHP/5.3.10-1ubuntu3.2
Set-Cookie: PHPSESSID=kr0p5e7q4l353gh8g80k4t9i90; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: public, max-age=3600
Pragma: cache
Vary: Accept-Encoding
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=utf-8
Length: unspecified [text/html]
Saving to: `STDOUT'
<!doctype html>
....
How should the template file being modified to send correct header(...) Codes ?
1 Comment
sorted by
Votes
Date Added
Vote Up
0
Vote Down
Petr Jasek
July 2012
Posts: 144
Member
hi,
i've made a plugin for 4.0.2. described in
wiki
if you want to use it in your current version, download attached file in include/smarty/campsite_plugins folder.
petr
function.set_http_response_code.php
511B
Post edited by Petr Jasek at 2012-07-11 04:06:09
Add a Comment
Start a New Discussion
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
Categories
All Discussions
8,397
Sourcefabric
↳
Announcements
25
Newscoop
↳
Newscoop Support
2,189
↳
Newscoop Development
722
↳
Newscoop Security
13
↳
Newscoop Documentation
17
↳
Newscoop Themes
69
Airtime
↳
Airtime Support
3,139
↳
Airtime Development
1,286
↳
Airtime Français
146
↳
Airtime Documentation
14
↳
Airtime Hacks
102
↳
Promote your station!
37
↳
Airtime Security
11
Booktype
↳
Booktype Support
277
↳
Booktype Development
55
↳
Booktype Documentation
7
Superdesk
↳
Superdesk Development
264
↳
Web Publisher
21
Poll
No poll attached to this discussion.
Top Posters
Albert FR
1978
Martin Konecny
1860
Andrey Podshivalov
1526
Voisses Tech
1423
John Chewter
899
Daniel James
844
Roger Wilco
784
hoerich
627
Paul Baranowski
389
Cliff Wang
339