andersundsehr/reduce-duplicate-content
Composer 安装命令:
composer require andersundsehr/reduce-duplicate-content
包简介
redirect if page has a / at the end (or not). (reduce Duplicate Content)
README 文档
README
composer req andersundsehr/reduce-duplicate-content
What dose this Extension do?
it aims to reduce the URL's there the same content is reachable.
The main point is that by default TYPO3's pages are accessible like this: /en/page-a and /en/page-a/.
With one simple setting you can change if you always want trailing Slashes or if you never want them.
This setting only sets the way TYPO3 generates the URL's.
But the content is still accessible by both URL's
This is there this Extension comes in.
How dose it solve this Problem:
We Generate a URL for the Current Page and Language.
If this URL matches the current Request URL (ignoring the Slash at the end.)
Only than we directly compare the URL's.
If they do not match we redirect to the correct URL.
How is it different to studiomitte/redirect2trailingslash
EXT:redirect2trailingslash is only usefull if you always want slashes at the end.
With our approach it is also possible to remove the slashes.
Also it should have way less errors because of the way we compare it with the generated URL's.
If you want Trailing Slashes:
you can configure a routeEnhancer like this:
file: config/sites/.../config.yaml
routeEnhancers: PageTypeSuffix: type: PageType # if you want to have trailing slashes for all pages: default: '/' index: '' map: /: 0 sitemap.xml: 1533906435
If you do not want Trailing Slashes:
you can remove the RouteEnhancer PageType.
or make sure that you do not use the default:
file: config/sites/.../config.yaml
routeEnhancers: PageTypeSuffix: type: PageType index: '' map: /: 0 sitemap.xml: 1533906435
If you use staticfilecache you need to add these lines in the nginx config:
# Ensure we redirect to TYPO3 for non GET/HEAD requests if ($request_method !~ ^(GET|HEAD)$ ) { return 405; } # Ensure we redirect to TYPO3 for urls ending with slash ####### THIS if ($request_uri ~ "^.*/$") { return 405; } # Ensure we redirect to TYPO3 for urls ending without slash ####### OR THIS if ($request_uri !~ "^.*/$") { return 405; } charset utf-8; default_type text/html; try_files /typo3temp/tx_staticfilecache/https_${host}_443${uri}/index /typo3temp/tx_staticfilecache/${scheme}_${host}_${server_port}${uri}/index =405;
Important! If you use staticfilecache:
If you use staticfilecache, you have to disable the fallback middleware of staticfilecache:
Change the 307 Status Code:
You can change it in the Extension Settings.
with ♥️ from anders und sehr GmbH
If something did not work 😮
or you appreciate this Extension 🥰 let us know.
We are hiring https://www.andersundsehr.com/karriere/
andersundsehr/reduce-duplicate-content 适用场景与选型建议
andersundsehr/reduce-duplicate-content 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 15.86k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2023 年 03 月 27 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 andersundsehr/reduce-duplicate-content 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 andersundsehr/reduce-duplicate-content 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 15.86k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2023-03-27