URL Redirection System Documentation
Overview
The URL Redirection System allows you to create intelligent redirects that can handle dynamic URL patterns, wildcards, and regex patterns. This system is particularly useful for migrating old URLs to new structures, handling dynamic content, and maintaining SEO-friendly redirects.
404 Request →
├── Check excluded paths (static files, etc.)
├── **Tier 1: Simple Redirects**
│ ├── Check Redirect model for exact matches
│ ├── Handle trailing slash variations
│ └── Handle query parameters
├── **Tier 2: Pattern Redirects** (if Tier 1 fails)
│ ├── Check RedirectApplication for pattern matches
│ ├── Use wildcard/regex pattern matching
│ └── Apply variable substitution
├── Language code handling
└── 404 logging and custom error pageFeatures
Pattern Matching: Support for normal URLs, wildcards (
*), and regex patternsDynamic Variables: Use captured groups in redirect URLs with
$1,$2, etc.Query Parameter Preservation: Automatically preserves query parameters during redirects
Getting Started
Accessing the Admin Interface
Navigate to Django Admin
Go to Pinogy Redirect → Pattern Redirects
Click Add Pattern Redirect
Basic Configuration
Each redirect requires:
Source URL Pattern: The pattern to match incoming URLs
Available Pages: The target CMS page for the redirect
Extra path after the selected page: Optional additional path with variable support
Site: The site this redirect applies to
Pattern Types
Type | Pattern | Target Page | Extra Part | Input | Output |
|---|---|---|---|---|---|
Normal |
|
| (empty) |
|
|
Single Wildcard |
|
|
|
|
|
Multiple Wildcards |
|
|
|
|
|
Leading Wildcard |
|
|
|
|
|
Leading Wildcard |
|
|
|
|
|
Regex |
|
|
|
|
|
Variable Substitution
Variable | Description | Pattern | Extra Part | Input | Output |
|---|---|---|---|---|---|
| First capture group |
|
|
|
|
| Second capture group |
|
|
|
|
| Third capture group |
|
|
|
|
Advanced Examples
Use Case | Pattern | Target Page | Extra Part | Input | Output |
|---|---|---|---|---|---|
E-commerce Products |
|
|
|
|
|
Blog Categories |
|
|
|
|
|
Multi-language |
|
|
|
|
|
Date Restructuring |
|
|
|
|
|
Important Discalimer
Be extremely careful with pattern matching and variable substitution! When creating redirect patterns, ensure your patterns are precise and tested thoroughly before adding. Only use variable substitution ($1, $2, etc.) if you are absolutely certain that the captured slug will be exactly the same in the target URL. In most of scenarios, slugs and identifiers change between old and new URL structures, so variable substitution should be used sparingly