Registry / web-framework / sphinxext-rediraffe

sphinxext-rediraffe

JSON →
library0.3.0pypypiunverified

sphinxext-rediraffe is a Sphinx extension that generates HTTP redirects (via HTML meta refresh tags) for non-existent pages, pointing them to specified working pages. This is useful for maintaining SEO and user experience when restructuring documentation. It is currently at version 0.3.0 and typically releases updates as needed for bug fixes, compatibility with new Sphinx versions, or minor features.

pip install sphinxext-rediraffe
INSTALL
IMPORT
SIG · SPHINXEXT-REDIRAFF
S
sphinxext-rediraffe
web-frameworkpythonv0.3.0
Install
5.2s avg
Import
Disk
94MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.3.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 92.1MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 5.2s · import 0.000s · 93MB
94MB installed
● package 94MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

sphinxext.rediraffe
extensions = ['sphinxext.rediraffe']
Add this string to the 'extensions' list in your conf.py file.

To quickly set up `sphinxext-rediraffe`, first add it to your `extensions` list in `conf.py`. Then, configure the `rediraffe_redirects` setting, either by pointing it to a text file (e.g., `redirects.txt`) where each line specifies an old path followed by a new path, or by providing a dictionary directly in `conf.py`.

# conf.py extensions = [ 'sphinxext.rediraffe', ] # Option 1: Path to a text file with redirects (preferred for many redirects) rediraffe_redirects = "redirects.txt" # Option 2: A dictionary mapping old paths to new paths (for fewer redirects) # rediraffe_redirects = { # "old/page": "new/page.html", # "legacy_docs/index": "current_docs/welcome.html", # } # --- redirects.txt (example content, place in your source directory) --- # old/path/to/file new/path/to/target.html # old_directory/some_page new_directory/another_page.html # old/index new/home.html # A comment line starts with a hash
Debug
Known issues
gotchaThe most common issue is forgetting to add 'sphinxext.rediraffe' to the `extensions` list in your `conf.py` file. Without this, Sphinx will not load the extension.
fix
Ensure `extensions = ['sphinxext.rediraffe', ...]` is present in your `conf.py`.
affects: All versions
gotchaSince version 0.2.0, the `rediraffe_redirects` setting defaults to `None`. You must explicitly configure this setting with either a path to a redirects file or a dictionary; otherwise, no redirects will be generated.
fix
Set `rediraffe_redirects` in `conf.py` to a string (path to file) or a dictionary mapping old to new paths.
affects: >=0.2.0
gotchaPaths specified in `rediraffe_redirects` (both file and dictionary methods) should be relative to your Sphinx source directory and use forward slashes (`/`), even on Windows. Do not include `.rst` or other source file extensions for the 'old' paths; specify the target HTML file (e.g., `new_page.html`) for the 'new' paths.
fix
Review your `redirects.txt` file or `rediraffe_redirects` dictionary to ensure paths are relative, use forward slashes, and correctly target HTML output files.
affects: All versions
gotchaIf you point `rediraffe_redirects` to a file, ensure that the file exists and is accessible. If the file is not found, `sphinxext-rediraffe` will log a warning and skip redirect generation for that configuration.
fix
Verify the path provided in `rediraffe_redirects` in `conf.py` and confirm the file is present at that location.
affects: All versions
Upgrade
Version history
0.3.0latest on PyPI · released Sep 28, 2025
Audit
Dependencies
SphinxrequiredThis is a Sphinx extension and requires Sphinx to function.
Agent activity
6 hits · last 30 days
node
6
Resources
sphinxext-rediraffe — pip install sphinxext-rediraffe · libregistry