This is a simple HTTP redirector for APT

More background at

It's intended for use when your organisation has a local mirror which
is only visible from inside their network. You want your portable device
(laptop, tablet, ...) to use that when you're at work, and not when
you're elsewhere with no access to it.

You need to:

0) Pick a URL for your director, such as

1) Mount to handle all requests to that URL. For Apache 2, a
   virtualhost with something like this should do the job:

        DocumentRoot /srv/www/
        AddHandler cgi-script .py

        <Directory /srv/www/>
        RewriteEngine On
        RewriteCond %{REQUEST_FILENAME} !-f
        # gets the requested URI from REQUEST_URI environment
        # variable. Don't try and pass it through here as the encoding of
        # some characters, notably +, gets messed up
        RewriteRule .* [L]

2) Change the Debian entries (except for Debian security) in your APT
   sources.list to use

3) Test by running apt-get update. There should be no errors