An Apache httpd module that returns HTTP 410 Gone for URIs listed in a map file. Port of nginx-gone for Apache.
- Simple map file — one URI per line, read once at config load
- Exact matching — O(1) hash table lookup for exact URIs
- Regex matching — PCRE patterns with
~(case-sensitive) and~*(case-insensitive) - Per-context control — enable/disable at server or directory/location level
- Early interception — translate_name hook, before content handlers
- No dependencies — pure Apache API (APR), no external libraries
- Dynamic module — works with
LoadModule - nginx map compatible — reuse existing map files (second column ignored)
📖 Wiki - Guides, tutorials, and reference
💬 Discussions - Questions, help, and feedback
Debian/Ubuntu:
# Add the OBS repository (see Installation Guide for details)
apt install apache-goneFedora/RHEL:
# Add the OBS repository (see Installation Guide for details)
dnf install apache-gonecat > /etc/apache2/maps/gone.map <<EOF
# Removed blog posts
/blog/2020/deleted-post 1
/blog/2019/old-article 1
# Discontinued products
/products/old-widget 1
# Regex: everything under /deprecated/
~^/deprecated/ 1
# Case-insensitive: old PHP pages
~*^/old-(.*)\.php$ 1
EOFLoadModule gone_module modules/mod_gone.so
# Load the gone URI map (read once at startup / reload)
GoneMapFile /etc/apache2/maps/gone.map
<VirtualHost *:80>
ServerName example.com
GoneEnabled on
DocumentRoot /var/www/html
# Disable gone checking for the API
<Location /api>
GoneEnabled off
</Location>
</VirtualHost>apachectl configtest && apachectl graceful
curl -I http://example.com/blog/2020/deleted-post
# HTTP/1.1 410 Gone| Directive | Context | Default | Description |
|---|---|---|---|
GoneEnabled |
server, directory, location | off |
Enable/disable gone checking |
GoneMapFile |
server config | — | Path to URI list file |
GoneUseRequestUri |
server config | off |
Match original request URI instead of decoded URI |
# Comments start with #
/exact/path 1 # Exact match
~^/regex/pattern 1 # Case-sensitive regex
~*^/case-insensitive 1 # Case-insensitive regex
- One URI per line
- Second column is optional (ignored, for nginx map compatibility)
~prefix = case-sensitive PCRE regex~*prefix = case-insensitive PCRE regex- Everything else = exact string match
cd src
apxs -i -a -c mod_gone.csrc/— Apache module source codeconf/— Example configurationtest/— Test suitedebian/— Debian packaging files
| Module | Description | GitHub |
|---|---|---|
| apache-cf-realip | Automatic Cloudflare IP list for RemoteIPTrustedProxy | GitHub |
| apache-torblocker | Control access from Tor exit nodes | GitHub |
| apache-waf | IP/CIDR-based access control with named lists | GitHub |
| apache-waf-api | REST API daemon for dynamic IP list management | GitHub |
| apache-waf-feeds | Automatic threat feed updater | GitHub |
| apache-waf-ui | Web management interface | GitHub |
| nginx Module | Apache Module |
|---|---|
| nginx-gone | apache-gone (this project) |
| nginx-cf-realip | apache-cf-realip |
| nginx-torblocker | apache-torblocker |
| nginx-waf | apache-waf |
Apache License 2.0. See LICENSE.md.