migratetoflarum/canonical
Composer 安装命令:
composer require migratetoflarum/canonical
包简介
Create redirects to the canonical url of your forum
关键字:
README 文档
README
This extensions creates redirects so that Flarum can only be accessed via the url defined in config.php.
First note: your host might already be doing those redirects for you. If that's the case, then you don't need this extension.
Second note: if your host supports configuring redirects (via Apache Rewrites or Nginx server rules for example), I recommend using that instead of an extension for better performance. If those features are not available or if you don't have the technical knowledge to use them, then this extension is for you!
Third note: this extension does not work with Flarum installs in subfolders.
Installation
composer require migratetoflarum/canonical
Updating
composer require migratetoflarum/canonical php flarum cache:clear
Documentation
To enable the redirects, first enable the extension in your Flarum dashboard. Then access the extension settings and select a redirect status.
The extension settings will only be available when you access the forum via the canonical url.
This should prevent you from getting locked outside of the forum if Flarum cannot actually be reached via the url defined in config.php.
Before continuing, you should make sure the url value in config.php is the URL you want as canonical.
In particular if HTTPS is enabled on your host (as it should), make sure the canonical url includes https://.
You should first enable the temporary redirect option, so you can test the redirects without them being cached in every browser and search engine browsing the forum.
If your forum uses a bare domain (no www. subdomain), try accessing the www. subdomain and you should be redirected with a 302 status.
If your forum uses a www. subdomains, try accessing the bare domain (without www.).
Likewise, if your forum uses an HTTPS canonical url (again, as it should), trying to access it via http:// should result in a 302 redirect to https://.
Once you confirmed everything is okay, you can switch the redirect status to permanent. The redirect status code will be switched from 302 to 301. Browsers and search engines will cache those redirects and stop to consider those pages as duplicates.
After all of this is done you can also submit your forum for a scan on the MigrateToFlarum Lab as an additional check 😉.
Rescue mission
If you somehow get locked out of your forum because of a faulty redirect, here's what you can do:
- If you changed your forum hostname, update the
urlvalue inconfig.phpand the extension will now redirect to that new url - If you need to disable the redirects but don't have access to the dashboard anymore, you can manually edit the
migratetoflarum-canonical.statusentry in thesettingstable of your forum database. Set the value to0to disable the redirects
In any case, if a permanent redirect was cached and prevents you from accessing the address you need, you might have to clear:
- Your browser cache
- Cloudflare cache or the cache of other proxies your website is using
- If a search engine cached an incorrect redirect, you'll have to wait for it to expire or try to manually submit the page to the search engine for a new try
A MigrateToFlarum extension
This is a free extension by MigrateToFlarum, an online forum migration tool (launching soon). Follow us on Twitter for updates https://twitter.com/MigrateToFlarum
Need a custom Flarum extension ? Contact Clark Winkelmann !
Links
migratetoflarum/canonical 适用场景与选型建议
migratetoflarum/canonical 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 5.3k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2019 年 03 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「url」 「extension」 「canonical」 「flarum」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 migratetoflarum/canonical 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 migratetoflarum/canonical 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 migratetoflarum/canonical 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
return the canonical url from a string of html
Avoiding Duplicate Content. Extension for Contao Open Source CMS
A custom URL rule class for Yii 2 which allows to create translated URL rules
Harvest statistics and meta data from an URL or his source code (seo oriented).
A CakePHP plugin for SEO meta tags, OpenGraph and Twitter Cards
The Yii2 extension uses jQuery jquery.carousel-1.1.min.js and makes image carousel from php array of structure defined.
统计信息
- 总下载量: 5.3k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 14
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-03-13