https://github.com/flowpack/flowpack.seorouting
Enfore trailing slash / case insensitive urls in Neos CMS
https://github.com/flowpack/flowpack.seorouting
case-insensitive flow lowercase lowercase-conversion neos neoscms seo trailing-slash urls
Last synced: about 1 month ago
JSON representation
Enfore trailing slash / case insensitive urls in Neos CMS
- Host: GitHub
- URL: https://github.com/flowpack/flowpack.seorouting
- Owner: Flowpack
- License: mit
- Created: 2025-01-16T14:43:54.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-11-21T11:08:23.000Z (4 months ago)
- Last Synced: 2025-12-24T11:47:43.068Z (3 months ago)
- Topics: case-insensitive, flow, lowercase, lowercase-conversion, neos, neoscms, seo, trailing-slash, urls
- Language: PHP
- Homepage:
- Size: 26.4 KB
- Stars: 1
- Watchers: 10
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Flowpack.SeoRouting
* [Flowpack.SeoRouting](#flowpackseorouting)
* [Sponsoring](#sponsoring)
* [Introduction](#introduction)
* [Features](#features)
* [Installation](#installation)
* [Configuration](#configuration)
* [Standard Configuration](#standard-configuration)
* [Trailing slash mode](#trailing-slash-mode)
* [Blocklist for redirects](#blocklist-for-redirects)
* [Thank you](#thank-you)
## Sponsoring
Thank you [Biallo & Team GmbH](https://www.biallo.de/) for sponsoring the work from Sandstorm on this package.
## Introduction
This package allows you to enforce a trailing slash or enforce no trailing slash and/or lower case urls in Flow/Neos.
## Features
Main features:
- **trailingSlash**: ensure that all rendered internal links in the frontend end with a trailing slash (e.g. `example.
com/test/` instead of `example.com/test`) and all called URLs without trailing slash will be redirected to the same
page with a trailing slash or the opposite (e.g. `example.com/test` instead of `example.com/test/`)
- **toLowerCase**: ensure that camelCase links gets redirected to lowercase (e.g. `example.com/lowercase` instead of
`example.com/lowerCase`)
You can de- and activate both of them.
Another small feature is to restrict all _new_ Neos pages to have a lowercased `uriPathSegment`. This is done by
extending the `NodeTypes.Document.yaml`.
## Installation
Just require it via composer:
`composer require flowpack/seo-routing`
If you want to use the *toLowerCase* feature you should execute the migration that comes with this package:
`./flow node:migrate 20250124153030 --confirmation true`
This migration transforms all the URLs of all your nodes to lowercase. It's irreversible.
## Configuration
### Standard Configuration
In the standard configuration we have activated the trailingSlash (to redirect all uris without a / at the end to an uri
with / at the end) and do all redirects with a 301 http status.
*Note: The lowercase redirect is deactivated by default, because you have to make sure, that there is
no Neos page with an `uriPathSegment` with camelCase or upperspace letters - this would lead to redirects in the
neverland. You can achieve this by running the migration that ships with this package,
see [installation](#installation).*
```
Flowpack:
SeoRouting:
redirect:
enable:
trailingSlash: true
toLowerCase: false
trailingSlashMode: 'add'
statusCode: 301
blocklist:
'/neos.*': true
```
### Trailing slash mode
You can set the `trailingSlashMode` to `add` or `remove`. For this setting to have an effect you have to set
`trailingSlash` to true.
This effects redirects and all rendered internal urls.
### Blocklist for redirects
By default, all `/neos` URLs are ignored for redirects. You can extend the blocklist array with regex as you like:
```yaml
Flowpack:
SeoRouting:
blocklist:
'/neos.*': true
```
## Thank you
This package originates from https://github.com/t3n/seo-routing.
Thank you, T3N and associates for your work.