https://github.com/t3n/seo-routing
Flow Framework Router to ensure a trailing slash
https://github.com/t3n/seo-routing
flow flowframework flowpackage neos neoscms
Last synced: 5 months ago
JSON representation
Flow Framework Router to ensure a trailing slash
- Host: GitHub
- URL: https://github.com/t3n/seo-routing
- Owner: t3n
- License: mit
- Created: 2019-05-03T09:35:21.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-07-03T08:41:38.000Z (over 2 years ago)
- Last Synced: 2024-11-14T20:47:20.082Z (about 1 year ago)
- Topics: flow, flowframework, flowpackage, neos, neoscms
- Language: PHP
- Homepage:
- Size: 51.8 KB
- Stars: 1
- Watchers: 8
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://circleci.com/gh/t3n/seo-routing) [](https://packagist.org/packages/t3n/seo-routing) [](https://packagist.org/packages/t3n/seo-routing) [](https://packagist.org/packages/t3n/seo-routing)
# t3n.SEO.Routing
This package has 2 main features:
- **trailingSlash**: ensure that all links ends with a trailing slash (e.g. `example.com/test/` instead of `example.com/test`)
- **toLowerCase**: ensure that camelCase links gets redirected to lowercase (e.g. `exmaple.com/lowercase` instead of `exmaple.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 t3n/seo-routing```
## Configuration
### Standard Configuration
In the standard configuration we have activated the trailingSlash (to redirect all uris without a / at the and to an uri with / at the end) and do all redirects with a 301 http status.
*Note: The lowercase redirect is deactivated by default, cause you have to make sure, that there is no `uriPathSegment` with camelCase or upperspace letters - this would lead to redirects in the neverland.*
```
t3n:
SEO:
Routing:
redirect:
enable:
trailingSlash: true
toLowerCase: false
statusCode: 301
blacklist:
'/neos/.*': true
```
### Blacklist for redirects
By default, all `/neos/` URLs are ignored for redirects. You can extend the blacklist array with regex as you like:
```yaml
t3n:
SEO:
Routing:
#redirect:
#...
blacklist:
'/neos/.*': true
```