fork/craft-here
Composer 安装命令:
composer require fork/craft-here
包简介
Use the SEO plugin redirects to write nginx and apache redirect map config files (perfect for headless Craft CMS Setups)
README 文档
README
Table of contents
Features
- Manage custom redirects directly within the server configuration (for Nginx and Apache)
- Perfectly suited for headless Craft CMS Setups
- Use the redirects features and UI of the Craft SEO Plugin
Requirements
- Craft CMS 5
- Craft SEO Plugin
Setup
1. Install
Install the package
cd /path/to/project
composer require fork/craft-here
2. Configuration file
- Copy the example
config.phpto your Craft config directory and rename it toredirects.php - Specify the server type (and a reload command if you use nginx). Here's an example:
<?php return [ // Global settings '*' => [ 'serverType' => 'nginx' // or 'apache' ], // Dev environment settings 'dev' => [ //'redirectsReloadCommand' => 'my-command', ], // Staging environment settings 'staging' => [ ], // Production environment settings 'production' => [ //'redirectsReloadCommand' => 'sudo /etc/init.d/nginx reload', ], ];
In your server configuration include the redirect map files (which will be created after plugin has been installed):
# NGINX EXAMPLE: # see https://serverfault.com/a/890715/487169 for why we use "[.]" instead of a regular period "." include /var/www/html/redirects/my.domain.com/redirects-301[.]map; include /var/www/html/redirects/my.domain.com/redirects-302[.]map; # 301 MOVED PERMANENTLY if ($redirect_moved = false) { set $redirect_moved ""; } if ($redirect_moved != "") { rewrite ^(.*)$ $redirect_moved permanent; } # 302 FOUND (aka MOVED TEMPORARILY) if ($redirect_found = false) { set $redirect_found ""; } if ($redirect_found != "") { rewrite ^(.*)$ $redirect_found redirect; }
# APACHE EXAMPLE: RewriteEngine On RewriteMap redirects-301 txt:/var/www/html/redirects/my.domain.com/redirects-301.map RewriteMap redirects-302 txt:/var/www/html/redirects/my.domain.com/redirects-302.map RewriteCond ${redirects-301:%{REQUEST_URI}} ^.+$ RewriteRule .* https://${redirects-301:%{HTTP_HOST}%{REQUEST_URI}} [redirect=permanent,last] RewriteCond ${redirects-302:%{REQUEST_URI}} ^.+$ RewriteRule .* https://${redirects-302:%{HTTP_HOST}%{REQUEST_URI}} [redirect=temp,last]
Usage
Once the plugin has been installed it will create all necessary redirect map files which need to be included into the server config. After that just use the SEO Plugin UI to manage your redirects.
Roadmap
- Settings maybe (instead of config file)
Brought to you by Fork Unstable Media GmbH
fork/craft-here 适用场景与选型建议
fork/craft-here 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 550 次下载、GitHub Stars 达 6, 最近一次更新时间为 2020 年 12 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「cms」 「redirect」 「headless」 「apache」 「nginx」 「redirects」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 fork/craft-here 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 fork/craft-here 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 fork/craft-here 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Redirects TYPO3 visitors automatic or with a suggestlink to another language and/or root page.
This extension provides integration with solr to output content from TYPO3 in JSON format.
GraphQL authentication for your headless Craft CMS applications.
Set Links with a specific language parameter
Instrument headless chrome/chromium instances from php5.6
Supercharged text field validation.
统计信息
- 总下载量: 550
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 13
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-12-23