Forum

Returning a specific HTTP status code?

Saadat
11 January 2014, 12:07
Hi,

I have an old blog that I no longer update, so I converted its content to static HTML pages. This static version is being served by Hiawatha perfectly.

However, I am getting a lot of hits for the blog's feed URL (which is no longer there), and thus, there are a lots of 404s being returned. I was wondering if there's a way (using Hiawatha's URL toolkit, perhaps) to return "410 Gone" for each request asking for the feed URL. The manual for URL toolkit doesn't mention returning a specific HTTP code, so I though to ask here to see if it's possible...

Thanks.

Hiawatha version: 9.2
Operating System: Arch Linux
Hugo Leisink
13 January 2014, 20:32
Try this configuration:
UrlToolkit {
ToolkitID = 410_gone
RequestURI exists Return
Match .* Rewrite /410.php
}


410.php:
<?php
header("Status: 410 Gone");
?>
Saadat
14 January 2014, 13:05
Thanks, Hugo. This works great. (The 404 page can now rest!)
This topic has been closed.