Skip to content

Instantly share code, notes, and snippets.

View BMeu's full-sized avatar

Bastian Meyer BMeu

View GitHub Profile
@BMeu
BMeu / apache-404-error-passing-url.rst
Last active June 22, 2020 12:12
Apache: passing the requested URL to a 404 error document

Apache: Passing the Requested URL to a 404 Error Document

Sometimes you may want to pass the URL that triggered a 404 Not Found error on your Apache server to a script handling the error. Of course, you could simply set the ErrorDocument 404 /path/to/error/script directive and access the environment variables set by the directive to retrieve the requested URL. But what if this is not an option and you want the requested URL as a parameter when calling the script (see below for an example where this might be useful)? Unfortunately, the ErrorDocument does not allow rewriting the URL...

We could simulate the ErrorDocument 404 behavior using the rewrite module. Since we do not want to hardcode any URLs into

@BMeu
BMeu / raspbian-python3.5.rst
Created October 12, 2016 19:16
Installing Python 3.5 on Raspbian

Installing Python 3.5 on Raspbian

As of October 2016, Raspbian does not yet include the latest Python release, Python 3.5. This means we will have to build it ourselves, and here is how to do it.

  1. Install the required build-tools (some might already be installed on your system).