bnomei / kirby3-redirects
Setup performant HTTP Status Code Redirects from within the Kirby Panel
Installs: 7 823
Dependents: 0
Suggesters: 1
Security: 0
Stars: 22
Watchers: 3
Forks: 2
Open Issues: 2
Type:kirby-plugin
Requires
- php: >=8.1
- getkirby/composer-installer: ^1.2
Requires (Dev)
- getkirby/cms: ^4.1.0
- php-coveralls/php-coveralls: ^2.4
- phpunit/phpunit: ^9.5
- spatie/ray: ^1.41
Suggests
- bnomei/kirby3-csv: Adds functions to import and export data from structures (like the redirect table)
- bnomei/kirby3-feed: Add xml-rss and/or json feed
- bnomei/kirby3-robots-txt: Automatic robots.txt. Detects xmlsitemap.
- bnomei/kirby3-security-headers: CPS headers to make the the web a saver place. Sensible defaults with zero configuration.
- dev-master
- 4.3.0
- 4.2.3
- 4.2.1
- 4.2.0
- 4.1.0
- 4.0.0
- 1.12.0
- 1.11.0
- 1.10.0
- 1.9.1
- 1.9.0
- 1.8.0
- 1.7.0
- 1.6.0
- 1.5.9
- 1.5.8
- 1.5.7
- 1.5.6
- 1.5.5
- 1.5.4
- 1.5.3
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.3
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.0
- 1.2.3
- 1.2.1
- 1.2.0
- 1.1.9
- 1.1.8
- 1.1.7
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.1
- 1.0.0
- dev-dependabot/composer/guzzlehttp/psr7-2.5.0
This package is auto-updated.
Last update: 2024-11-23 16:18:41 UTC
README
Setup performant HTTP Status Code Redirects from within the Kirby Panel.
Kirby Redirects can redirect any request URI to any response URI. It can also handle querystrings and regex.
Similar Plugin
- kirby-retour but it can only handle Kirby Routes. It is the better choice when updating a Kirby 2 project or creating a brand new Kirby 3 project.
Works well with
- CSV Plugin to help you import and export data to the redirects structure.
Installation
- unzip master.zip as folder
site/plugins/kirby3-redirects
or git submodule add https://github.com/bnomei/kirby3-redirects.git site/plugins/kirby3-redirects
orcomposer require bnomei/kirby3-redirects
Setup
Add the plugin-redirects
section to your site.yml
and add redirects in the panel.
site.yml
sections: # ...other sections redirects: extends: plugin-redirects3xx
If you need all http codes you can use
extends: plugin-redirects
instead.
Usage
In the structure field or using the provided site methods add Request-URIs fromuri
like
projects/cool
projects?id=123
projects/cool.html
projects\/.*\.html
blog\/(?P<year>\d{4})_(?P<slug>.*)\.html
and set Response-URIs touri
like
projects/changed-slug
https://exter.nal
blog/$year/$slug
as well as a HTTP Status Code code
like 301
or 302
.
This makes it the ideal choice when porting a non Kirby project.
Site Methods
The site methods appendRedirects
and removeRedirects
allow you to programmatically change the redirects table (if stored in a Page/Site-Object).
// add single item $success = site()->appendRedirects( ['fromuri'=>'/posts?id=1', 'touri'=>'/blog/1', 'code'=>301] ); // add multiple items with nested array $success = site()->appendRedirects([ ['fromuri'=>'/posts?id=2', 'touri'=>'/blog/2', 'code'=>301], // ... ['fromuri'=>'/posts?id=999', 'touri'=>'/blog/999', 'code'=>301], ]); // remove single item $success = site()->removeRedirects( ['fromuri'=>'/posts?id=1', 'touri'=>'/blog/1'] ); // remove multiple items with nested array $success = site()->removeRedirects([ ['fromuri'=>'/posts?id=3', 'touri'=>'/blog/3'], ['fromuri'=>'/posts?id=5', 'touri'=>'/blog/5'], ['fromuri'=>'/posts?id=7', 'touri'=>'/blog/7'], ]);
Protecting your Kirby from Bots
This plugin will block various routes of other popular CMS. It is enabled by default and will reduce the load on your website caused by bots looking for vulnerabilities in other CMS.
- Wordpress
- Joomla
- Drupal
- Magento
- Shopify
Settings
Disclaimer
This plugin is provided "as is" with no guarantee. Use it at your own risk and always test it yourself before using it in a production environment. If you find any issues, please create a new issue.
License
It is discouraged to use this plugin in any project that promotes racism, sexism, homophobia, animal abuse, violence or any other form of hate speech.
Credits
This plugins is similar yet way less powerful than K2 version of