PHPackages                             paxxion/craft-redirector - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. paxxion/craft-redirector

ActiveCraft-plugin

paxxion/craft-redirector
========================

Smart redirect management to preserve SEO integrity and site performance.

v1.0.7(3mo ago)010proprietaryTwigPHP &gt;=8.2

Since Nov 5Pushed 3mo agoCompare

[ Source](https://github.com/paxxion/craft-redirector)[ Packagist](https://packagist.org/packages/paxxion/craft-redirector)[ RSS](/packages/paxxion-craft-redirector/feed)WikiDiscussions craft5 Synced 1mo ago

READMEChangelog (8)Dependencies (3)Versions (9)Used By (0)

Redirector
==========

[](#redirector)

### A clear and practical introduction to redirects and SEO value

[](#a-clear-and-practical-introduction-to-redirects-and-seo-value)

Imagine a standard product entry on your site:
`https://my-site.test/products/pretty-normal-entry`

Your client asks you to move it to another category and rename it, resulting in:
`https://my-site.test/products/awesome-entries/really-awesome-entry`

Every internal link will update automatically if you’ve used dynamic URLs, but **external links won’t**.

### Why this matters

[](#why-this-matters)

Those external links include **other websites, bookmarked URLs saved in users’ browsers**, and, more importantly, **Google’s search index**, which still points to the old address. Users clicking those results will land on a **404 error page** and that’s bad for both experience and SEO.

### Why 404 pages can harm SEO

[](#why-404-pages-can-harm-seo)

A 404 (Not Found) page isn’t always bad as it’s a **normal and expected response** when a page truly doesn’t exist or has never existed.

However, when a 404 replaces a page that **previously contained valuable content**, it creates two main problems:

- users encounter a dead end instead of relevant information;
- search engines detect lost content and remove the page from their index, leading to:
    - **loss of PageRank and link equity** from inbound links,
    - **drop in search visibility** for related pages,
    - **delayed re-indexing** of the new URL.

In such cases, using a proper redirect is the best way to preserve both user experience and SEO value.

### The role of redirects

[](#the-role-of-redirects)

A **redirect** is a small HTTP instruction your server sends to browsers and search engines, saying:
“This page has moved. You can find it here.”

The browser and search engine crawlers, such as Googlebot, follow that direction and reach the correct page automatically.

There are several types of redirects, the most common being **301** and **302**:

- **301 (Permanent)** tells search engines to update their index and transfer SEO value to the new URL.
- **302 (Temporary)** keeps the old URL indexed, used for short-term moves.

From a user’s perspective, both behave the same way — but from an SEO standpoint, **301 redirects** are essential to preserve rankings and link equity.

### But URLs shouldn’t change, right?

[](#but-urls-shouldnt-change-right)

Ideally, yes, but in the real world they often do.
Products get rebranded or discontinued, categories are reorganized, and slugs evolve.
When that happens, having an automated redirect system is essential to maintain SEO integrity.

### Meet Redirector

[](#meet-redirector)

**Redirector** helps you easily manage redirects and preserve SEO value whenever URLs change.
It automatically handles redirects whenever an entry’s slug or its position within a Structure is updated, preventing 404 errors and protecting your site’s visibility.

Redirector allows you to manage 404 errors by generating **301 permanent redirects**, but also supports **302**, **307**, and **308** redirect types for temporary or advanced use cases. Additionally, it lets you assign a **410 Gone** status to 404 pages that should be permanently removed from your site, ensuring they are definitively excluded from search engine indexes.

You can:

- define exact-match or RegEx-based redirect rules;
- configure redirects globally or per site;
- monitor and manage all redirects through an intuitive interface.

Redirector automatically ensures that every moved, renamed, or deprecated entry maintains its SEO integrity, keeping your site structure clean and your rankings protected.

### AI-powered suggestions

[](#ai-powered-suggestions)

Redirector also offers optional AI-based assistance that helps automatically identify the most relevant redirect destinations. When enabled, the system can suggest the correct URL based on your site’s content (see the Settings section for instructions on how to generate this data), making it easier to manage complex redirects or large websites with many pages.

The AI suggestions are powered by OpenAI using its `gpt-5-nano` model in conjunction with the `file_search` tool, which retrieves suggestions from the custom knowledge base stored in a vector store.

Pricing info:

- `gpt-5-nano` model (  )
- `file_search` tool (  )

Requirements
------------

[](#requirements)

This plugin requires:

- **Craft CMS** 5.8.0 or later
- **PHP** 8.2 or later

Installation
------------

[](#installation)

You can install this plugin from the **Plugin Store** or with **Composer**.

#### From the Plugin Store

[](#from-the-plugin-store)

1. Open the **Plugin Store** in your project’s Control Panel.
2. Search for **“Redirector”**.
3. Click **Install** to complete the installation.

#### With Composer

[](#with-composer)

Open your terminal and run the following commands:

```
# go to the project directory
cd /path/to/my-project.test

# tell Composer to load the plugin
composer require paxxion/craft-redirector

# tell Craft to install the plugin
./craft plugin/install redirector
```

Usage
-----

[](#usage)

Once installed, the plugin will start:

- automatically logging any website requests that result in a 404 error into the Audit section
- generating automatic redirects if an entry’s slug or its position within a Structure changes

The plugin is divided into three sections:

- Audit
- Redirects
- Settings

Audit
-----

[](#audit)

This section shows all website requests that resulted in a 404 error.
For each website request it is possible to create a redirect clicking the plus icon at the end of the row.

The list can be exported as a CSV file. The exported file includes only the data that matches the applied filters, if any.

Redirects
---------

[](#redirects)

This section displays all redirects that have been created or imported manually, as well as those automatically generated by the plugin when an entry’s slug or structure position changes.

The list can be exported as a CSV file. The exported file includes only the data that matches the applied filters, if any.

The redirects can also be imported from CSV (comma or semicolon separated).

Settings
--------

[](#settings)

### Audit

[](#audit-1)

#### Excluded 404

[](#excluded-404)

These are exact match paths that will be excluded from being logged into the Audit section.

#### Excluded 404 Patterns

[](#excluded-404-patterns)

These are regex match paths that will be excluded from being logged into the Audit section.

### Redirects

[](#redirects-1)

#### OpenAI API Key

[](#openai-api-key)

An OpenAI API key can be configured to enable AI integration within the Redirects creation page (**AI** button on **Redirect To** field).
AI suggestions require a support knowledge base file that will be uploaded to the OpenAI servers.

After configuring the OpenAI API key, two buttons will appear in the settings:
**Generate data**: used to create the knowledge base data
**Upload data**: used to upload the data on OpenAI servers

To generate the knowledge base, create a **pxx-redirector.php** file inside the **config** folder.
This file must return, for each website entry/page, the following information:

- **Site**: The site handle of the entry/page
- **Language**: The language of the entry/page
- **Title**: The title of the entry/page
- **Description**: A short description about the content of the entry/page
- **Url**: The url of the entry/page

**Example of pxx-redirector.php file**:

```
