neos/redirecthandler
Composer 安装命令:
composer require neos/redirecthandler
包简介
Basic API to handle HTTP redirects with the Flow Framework
README 文档
README
The Neos.RedirectHandler package for Flow allows to create redirects that will be returned to the client.
It can be used to divert changed URLs to new targets without having to adjust the webserver configuration for each redirect.
Installation
To use the redirect package, you have to install this package
composer require "neos/redirecthandler"
and additionally a storage package. A default one for storing redirects in the database can be installed using composer with
composer require "neos/redirecthandler-databasestorage"
Using this package with Neos CMS
Check out the adapter package for Neos.
Upgrading from 2.x
The hit counter has been disabled by default.
You can enable it again in your Settings:
Neos:
RedirectHandler:
features:
hitCounter: true
The default status codes for redirects has been changed from 307 to 301 as mostly permanent redirects are desired instead of temporary.
You can enable the old behavior in your Settings:
Neos:
RedirectHandler:
statusCode:
redirect: 307
Configuration
Note: When using this to handle redirects for persistent resources, you must adjust the default
rewrite rules! By default, any miss for _Resources/… stops the request and returns a 404 from the
webserver directly:
# Make sure that not existing resources don't execute Flow
RewriteRule ^_Resources/.* - [L]
For the redirect handler to even see the request, this has to be removed. Usually the performance impact can be neglected, since Flow is only hit for resources that once existed and to which someone still holds a link.
What to do when redirects are not triggered but other controller actions
Override the routing order like this:
Neos: Flow: http: middlewares: redirect: position: 'before routing'
Be careful when using this configuration, as this will make the redirect component act first before any other route is resolved and could for example prevent a login or similar.
Possible problems
- When trying to redirect URLs with umlauts (or other special chars), be aware you might need to
enter them urlencoded. But to be able to enter
%C3%BCin place ofüyou will need to adjust the source path validation regex to allow%.
neos/redirecthandler 适用场景与选型建议
neos/redirecthandler 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 859.1k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2016 年 04 月 28 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 neos/redirecthandler 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 neos/redirecthandler 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 859.1k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 16
- 依赖项目数: 5
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-04-28