Forum

Force download

Fred
6 October 2016, 12:02
Hi Hugo,

On our Apache we used to be able to force download for pdf file using the following code in .htaccess file
<Files *.pdf>
ForceType application/octet-stream
Header set Content-Disposition attachment
</Files>

Could you please tell me if the same can be done in hiawatha?

Thank you
Fred
6 October 2016, 13:06
Here is another rule that I cannot get working...
In wordpress, I created a page called 404page that I can access via mydomain/404page
I then created the hiawatha entry:
ErrorHandler = 404:/404page?code=404

When I type ramdom stuff in url, I don't get my custom wordpress 404page but the generic 404.php from the theme

Could you please help
Hugo Leisink
6 October 2016, 19:44
No, Hiawatha does not have an option to add HTTP headers based on the extension of the requested file.

The ErrorHandler should point to an existing file. I don't think Wordpress has a file named 404page.
Fred
6 October 2016, 21:25
Hi hugo,

Is there any workaround you could sugest ofr the 404 redirect?
Hugo Leisink
8 October 2016, 00:27
I don't know Wordpress that well. What file should handle the 404 error? Point your ErrorHandler to that file.
This topic has been closed.