PHPackages                             huoxin/relative-url - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. huoxin/relative-url

ActiveFlarum-extension[Utility &amp; Helpers](/categories/utility)

huoxin/relative-url
===================

Converts internal Url to relative Url for multi-domain support

1.0.0(5mo ago)048MITPHPCI passing

Since Dec 19Pushed 4mo agoCompare

[ Source](https://github.com/huoxin233/flarum-ext-relative-url)[ Packagist](https://packagist.org/packages/huoxin/relative-url)[ RSS](/packages/huoxin-relative-url/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (4)Used By (0)

Relative Url
============

[](#relative-url)

[English](README.md) | [简体中文](README.zh-CN.md)

[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667) [![Latest Stable Version](https://camo.githubusercontent.com/cf18062c40f51969b81a431948b316e268889e0e7662f4ecc7ecbd78edb8b8e5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f68756f78696e2f72656c61746976652d75726c2e737667)](https://packagist.org/packages/huoxin/relative-url) [![Total Downloads](https://camo.githubusercontent.com/c35a70f8aeb4af25f3348bfb156c2d452b68708227ede5e66c92caa2c044d332/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f68756f78696e2f72656c61746976652d75726c2e737667)](https://packagist.org/packages/huoxin/relative-url)

A [Flarum](https://flarum.org) extension that converts internal URLs to relative paths for multi-domain support.

The Problem
-----------

[](#the-problem)

When your Flarum forum setup multi-domain by editing `config.php`:

```
'url' => 'https://' . \Illuminate\Support\Arr::get($_SERVER, 'HTTP_HOST', 'forum1.org'),

```

If an user post links with absolute URLs:

```
Check out https://forum1.org/d/123

```

Another user on `forum2.org` clicks this link, they're redirected to `forum1.org`, losing their session and cookies.

The Solution
------------

[](#the-solution)

This extension automatically converts internal URLs to relative paths:

- `https://forum1.org/d/123` → `/d/123`
- `https://forum2.org/u/username` → `/u/username`

Users stay on their current domain when clicking internal links.

Features
--------

[](#features)

- ✅ Converts regular links in post content
- ✅ Converts mention URLs (workaround for [flarum/framework#4226](https://github.com/flarum/framework/issues/4226) )

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

[](#installation)

Install with composer:

```
composer require huoxin/relative-url:"*"
```

Configuration
-------------

[](#configuration)

1. Go to **Admin → Extensions → Relative Url**
2. Add your internal domains (one per line):

```
forum1.org
forum2.org
forum.example.com

```

Updating
--------

[](#updating)

```
composer update huoxin/relative-url:"*"
php flarum migrate
php flarum cache:clear
```

Links
-----

[](#links)

- [Packagist](https://packagist.org/packages/huoxin/relative-url)
- [GitHub](https://github.com/huoxin233/flarum-ext-relative-url)
- [Discuss](https://discuss.flarum.org/d/38532-relative-url)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance75

Regular maintenance activity

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 50% 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 ~10 days

Total

3

Last Release

130d ago

Major Versions

1.0.0 → 2.0.0-beta.12026-01-08

### Community

Maintainers

![](https://www.gravatar.com/avatar/1a23b145759e2c9c8e646ee08a57ce031401480d9c9669807c150192bd0367ff?d=identicon)[huoxin233](/maintainers/huoxin233)

---

Top Contributors

[![flarum-bot](https://avatars.githubusercontent.com/u/39334649?v=4)](https://github.com/flarum-bot "flarum-bot (1 commits)")[![huoxin233](https://avatars.githubusercontent.com/u/23447157?v=4)](https://github.com/huoxin233 "huoxin233 (1 commits)")

---

Tags

urlrelativeflarumlinksmulti-domain

### Embed Badge

![Health badge](/badges/huoxin-relative-url/health.svg)

```
[![Health](https://phpackages.com/badges/huoxin-relative-url/health.svg)](https://phpackages.com/packages/huoxin-relative-url)
```

###  Alternatives

[fof/byobu

Well integrated, advanced private discussions.

61105.8k9](/packages/fof-byobu)[fof/user-bio

Add a user bio to user profiles

2196.5k9](/packages/fof-user-bio)[fof/drafts

Allow users to create post and discussion drafts

1771.1k5](/packages/fof-drafts)[fof/best-answer

Mark a post as the best answer in a discussion

26135.2k15](/packages/fof-best-answer)[fof/polls

 A Flarum extension that adds polls to your discussions

25122.4k9](/packages/fof-polls)

PHPackages © 2026

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