PHPackages                             innoweb/silverstripe-remove-trailing-slash - 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. innoweb/silverstripe-remove-trailing-slash

AbandonedArchivedSilverstripe-vendormodule[Utility &amp; Helpers](/categories/utility)

innoweb/silverstripe-remove-trailing-slash
==========================================

Removes the trailing slash from page links.

1.0.1(4y ago)0388BSD-3-ClausePHP

Since May 3Pushed 3y ago1 watchersCompare

[ Source](https://github.com/innowebau/silverstripe-remove-trailing-slash)[ Packagist](https://packagist.org/packages/innoweb/silverstripe-remove-trailing-slash)[ Docs](https://github.com/innowebau/silverstripe-remove-trailing-slash)[ RSS](/packages/innoweb-silverstripe-remove-trailing-slash/feed)WikiDiscussions master Synced 1mo ago

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

Silverstripe Remove Trailing Slash
==================================

[](#silverstripe-remove-trailing-slash)

[![Version](https://camo.githubusercontent.com/a556bd841aef093ea5a8189dcb10de55d7e72757732141121c8f8acda5b5b8c7/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696e6e6f7765622f73696c7665727374726970652d72656d6f76652d747261696c696e672d736c6173682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/innoweb/silverstripe-remove-trailing-slash)[![License](https://camo.githubusercontent.com/c740886727dfbcec9720422cdc365197ec0a608384b640085222416014da078e/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f696e6e6f7765622f73696c7665727374726970652d72656d6f76652d747261696c696e672d736c6173682e7376673f7374796c653d666c61742d737175617265)](license.md)

Overview
--------

[](#overview)

Removes the trailing slash from page links.

SiteTree is the only class in Silverstripe that adds trailing slashes to links. This module cleans that up.

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

[](#requirements)

- Silverstripe CMS 4.x

The changes from this module have been folded into core for Silverstripe 5, see [2780](https://github.com/silverstripe/silverstripe-cms/issues/2780).

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

[](#installation)

Install the module using composer:

```
composer require innoweb/silverstripe-remove-trailing-slash dev-master

```

Then run dev/build.

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

[](#configuration)

Unfortunately, `SiteTree::RelativeLink()` contains an issue, where the base link and action are joined with a forced `/`. When no action is available, this leaves a trailing slash.

Because the extension point `updateRelativeLink` is called before that join, you need to overwrite `Page::RelativeLink()` with the following code:

```
/**
 * Remove trailing slash from page links. SiteTree forces a trailing slash if no action is set, which doesn't
 * make sense, really. Every other functionality in SS doesn't add the trailing slash, e.g. in HTTP and
 * HTTPRequest classes.
 *
 * @see \SilverStripe\CMS\Model\SiteTree::RelativeLink()
 */
public function RelativeLink($action = null)
{
	$link = parent::RelativeLink($action);
	$link = rtrim($link, '/');
	return $link;
}

```

See details to this issue in [pull request 2677](https://github.com/silverstripe/silverstripe-cms/pull/2677).

License
-------

[](#license)

BSD 3-Clause License, see [License](license.md)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% 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 ~6 days

Total

2

Last Release

1463d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0d2e71d7787401a7bd4916062346163897f89f455d650ab32b5d60cd14825ad3?d=identicon)[xini](/maintainers/xini)

---

Top Contributors

[![xini](https://avatars.githubusercontent.com/u/1152403?v=4)](https://github.com/xini "xini (3 commits)")[![dizzystuff](https://avatars.githubusercontent.com/u/576903?v=4)](https://github.com/dizzystuff "dizzystuff (1 commits)")

---

Tags

silverstripeseotrailing slash

### Embed Badge

![Health badge](/badges/innoweb-silverstripe-remove-trailing-slash/health.svg)

```
[![Health](https://phpackages.com/badges/innoweb-silverstripe-remove-trailing-slash/health.svg)](https://phpackages.com/packages/innoweb-silverstripe-remove-trailing-slash)
```

###  Alternatives

[cyber-duck/silverstripe-seo

A SilverStripe module to optimise the Meta, crawling, indexing, and sharing of your website content

4351.1k](/packages/cyber-duck-silverstripe-seo)[axllent/silverstripe-trailing-slash

Ensure that a single trailing slash is always added to the URL

11182.6k5](/packages/axllent-silverstripe-trailing-slash)[silverstripe/multiuser-editing-alert

A module that indicates when people are editing the same page in the CMS

1530.7k1](/packages/silverstripe-multiuser-editing-alert)[silverstripers/seo

SEO for SilverStripe websites

1144.3k](/packages/silverstripers-seo)

PHPackages © 2026

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