PHPackages                             migratetoflarum/redirects - 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. [Database &amp; ORM](/categories/database)
4. /
5. migratetoflarum/redirects

AbandonedFlarum-extension[Database &amp; ORM](/categories/database)

migratetoflarum/redirects
=========================

Redirect urls to your Flarum

0.1.1(7y ago)22642MITPHPPHP &gt;=7.0

Since Jan 24Pushed 7y ago1 watchersCompare

[ Source](https://github.com/migratetoflarum/redirects)[ Packagist](https://packagist.org/packages/migratetoflarum/redirects)[ RSS](/packages/migratetoflarum-redirects/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (3)Used By (0)

Redirects extension by MigrateToFlarum
======================================

[](#redirects-extension-by-migratetoflarum)

[![Build status](https://camo.githubusercontent.com/c4d1276d4fd1fa5fbde92ee7329d72e15daa24f1028b8dba579fd30b3a3a8020/68747470733a2f2f7472617669732d63692e6f72672f6d696772617465746f666c6172756d2f7265646972656374732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/migratetoflarum/redirects) [![MIT license](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](https://github.com/migratetoflarum/redirects/blob/master/LICENSE.md) [![Latest Stable Version](https://camo.githubusercontent.com/94e88742e47068318df14f1dba403f05c0e7b110a23a49ed37e9755e961d05c7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d696772617465746f666c6172756d2f7265646972656374732e737667)](https://packagist.org/packages/migratetoflarum/redirects) [![Total Downloads](https://camo.githubusercontent.com/2005db60ddf7cf668c30803502371686264dc9bb61144ec942261b85a58ee493/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d696772617465746f666c6172756d2f7265646972656374732e737667)](https://packagist.org/packages/migratetoflarum/redirects) [![Donate](https://camo.githubusercontent.com/0d6e4d8b50b5983a58205941b1a581b1305903393b7a39da574e3f60af3c7f5b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f70617970616c2d646f6e6174652d79656c6c6f772e737667)](https://www.paypal.me/clarkwinkelmann)

This extension allows you to configure redirects to and from your Flarum. More settings are coming soon.

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

[](#installation)

**This extension requires PHP7 or above**

Use [Bazaar](https://discuss.flarum.org/d/5151-flagrow-bazaar-the-extension-marketplace) or install manually:

```
composer require migratetoflarum/redirects
```

Updating
--------

[](#updating)

```
composer update migratetoflarum/redirects
php flarum cache:clear
```

Documentation
-------------

[](#documentation)

You can configure rules that trigger a redirect when they match the current request. A rule has the following settings:

NameDefault valueDescriptionConditionA pattern that will be matched against the current request. You can specify a full URI or just part of it. You can include the protocol, hostname, port, path and query string. You can insert a wildcard `*` to replace a part of a subdomain, path or query string. The wildcard doesn't match `.` or `/` so it can't match a full domain name or full path. Query strings are matched separately, even if they are in a different order in the actual request. Query parameters present in the request but not in the condition are ignored and don't make the rule fail. If you don't specify a host, it's better to always start the path with `/` to prevent the rule from confusing host and path.Redirect ToThe url to redirect to. The value matched by wildcards in **Condition** can be used as `$1`, `$2` and so on. Special values `$scheme`, `$host` and `$path` will be replaced with the values extracted from the original request (`$scheme` is `http` or `https` and `$path` includes the starting `/`)Override FlarumNoBy default Rules are only run when Flarum encounters a 404 error to prevent slowing down the forum when rendering non-ruled routes. But if your rule also matches a route defined by Flarum or an extension, you'll need to enable this option to run the rule on every request. Be careful as you can lock yourself out of the forum if you match login or administrative routes !Redirect is externalNoBy default the **Redirect To** values gets the Flarum base url prepended to it. It's a safety feature that can prevent some unwanted redirects. But if you're using a different hostname on purpose as a redirect, you need to enable this option so your input is used as-it as the `Location` value for the redirectRedirect Type301Choose the HTTP status to send along with the redirect. `301` indicates a permanent redirect and will be cached by browsers and search engines. `302` is a temporary redirect that won't be cached by browsers and usually has no meaning for search engines. Using 302 while testing your settings is easier as you won't have to clear your browser cache if something goes wrong.Enable ruleAs the name suggests, this allows you to activate or disable a rule. A rule can only be activated once you set a **Condition** and a **Redirect To** value.Please note that as Flarum beta7, any rule starting with `/admin` will only work for users with administrative privileges, because the redirect script can't run before the auth check there.

You can only redirect urls for domains that resolve to your Flarum installation. If you'd like to manage redirects from other domains, check your hosting dashboard or webserver documentation on how to add aliases.

Caching
-------

[](#caching)

The list of rules is saved to the cache so no additional database query is needed while running.

This list is cleared every time you edit the rules in the admin panel. If rules are not updating, you can try running `php flarum cache:clear` to clear the whole cache.

Examples
--------

[](#examples)

> Condition: `example.com`

Matches `https://example.com/`, `https://example.com/tags`, `http://example.com/?forum=1`

Doesn't match `https://forum.example.com/`, `https://example.net/`

> Condition: `https://*.example.com`

Matches `https://forum.example.com/`, `https://www.example.com/forum`

Doesn't match `https://example.com/`, `http://test.example.com/`

> Condition: `example.com/`

Matches `https://example.com/`

Doesn't match `https://example.com/tags`

> Condition: `/forum`

Matches `https://www.example.com/forum`, `https://example.net/forum`

Doesn't match `https://example.com/admin`

Real life examples
------------------

[](#real-life-examples)

### Redirect your forum to HTTPS

[](#redirect-your-forum-to-https)

You need to enable **Override Flarum** for this rule.

- Condition: `http://example.com`
- Redirect To: `$path` (or `https://$host$path` with **Redirect is external** enabled to stay on the subdomain even if it is different than the one in Flarum config)

### Redirect from [www](http://www). to apex

[](#redirect-from-www-to-apex)

You need to enable **Override Flarum** for this rule.

- Condition: `www.example.com`
- Redirect To: `$path` (or `$scheme://exemple.com$path` with **Redirect is external** enabled to redirect to a domain different from the one in Flarum config)

### Redirect an old forum homepage to Flarum

[](#redirect-an-old-forum-homepage-to-flarum)

- Condition: `/forum`
- Redirect To: `/`

- Condition: `/index.php`
- Redirect To: `/`

### Redirect discussions from an old forum

[](#redirect-discussions-from-an-old-forum)

- Condition: `/index.php?discussion=*`
- Redirect To: `/d/$1`

### Redirect unknown discussions to homepage

[](#redirect-unknown-discussions-to-homepage)

- Condition: `/d/*` (with **Override Flarum** disabled, otherwise any discussion will be redirected)
- Redirect To: `/`

### Rickroll every admin (including you)

[](#rickroll-every-admin-including-you)

You need to enable **Override Flarum** and **Redirect is external** for this rule.

- Condition: `/admin`
- Redirect To: `https://www.youtube.com/watch?v=dQw4w9WgXcQ`

PS: If you have not guessed it already, this will lock you out of the admin panel. You'll need to edit/delete the `migratetoflarum-redirects.rules` setting in your Flarum database to restore access to the admin panel.

A MigrateToFlarum extension
---------------------------

[](#a-migratetoflarum-extension)

This is a free extension by MigrateToFlarum, an online forum migration tool (launching soon). Follow us on Twitter for updates

Need a custom Flarum extension ? [Contact Clark Winkelmann !](https://clarkwinkelmann.com/flarum)

Links
-----

[](#links)

- [Flarum Discuss post](https://discuss.flarum.org/d/8597-redirects)
- [Source code on GitHub](https://github.com/migratetoflarum/redirects)
- [Report an issue](https://github.com/migratetoflarum/redirects/issues)
- [Download via Packagist](https://packagist.org/packages/migratetoflarum/redirects)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~263 days

Total

2

Last Release

2765d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0538135c1debcef5602dce7ece027909cc832b7a6284ab9189a19aa8de98d60d?d=identicon)[clarkwinkelmann](/maintainers/clarkwinkelmann)

---

Top Contributors

[![clarkwinkelmann](https://avatars.githubusercontent.com/u/5264300?v=4)](https://github.com/clarkwinkelmann "clarkwinkelmann (7 commits)")

---

Tags

migrationextensionflarumredirects

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/migratetoflarum-redirects/health.svg)

```
[![Health](https://phpackages.com/badges/migratetoflarum-redirects/health.svg)](https://phpackages.com/packages/migratetoflarum-redirects)
```

###  Alternatives

[c006/yii2-migration-utility

Automatically writes the create tables for migrations or create tables in general

63160.6k1](/packages/c006-yii2-migration-utility)[dmstr/yii2-migrate-command

Console Migration Command with multiple paths/aliases support

31295.5k6](/packages/dmstr-yii2-migrate-command)[hzhihua/yii2-dump

Generate the schema from an existing database

1828.5k1](/packages/hzhihua-yii2-dump)[flarum-lang/french

French language pack to localize the Flarum forum software plus its official and third-party extensions.

2033.8k](/packages/flarum-lang-french)[flarum/gdpr

Features for GDPR, PII management

1425.2k15](/packages/flarum-gdpr)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
