Download the PHP package migratetoflarum/redirects without Composer

On this page you can find all versions of the php package migratetoflarum/redirects. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package redirects

Redirects extension by MigrateToFlarum

Build status MIT license Latest Stable Version Total Downloads Donate

This extension allows you to configure redirects to and from your Flarum. More settings are coming soon.

Installation

This extension requires PHP7 or above

Use Bazaar or install manually:

Updating

Documentation

You can configure rules that trigger a redirect when they match the current request. A rule has the following settings:

Name Default value Description
Condition A pattern that will be matched against the current request. You can specify a full URI or just part of it. You can include the protocol, hostname, port, path and query string. You can insert a wildcard * to replace a part of a subdomain, path or query string. The wildcard doesn't match . or / so it can't match a full domain name or full path. Query strings are matched separately, even if they are in a different order in the actual request. Query parameters present in the request but not in the condition are ignored and don't make the rule fail. If you don't specify a host, it's better to always start the path with / to prevent the rule from confusing host and path.
Redirect To The url to redirect to. The value matched by wildcards in Condition can be used as $1, $2 and so on. Special values $scheme, $host and $path will be replaced with the values extracted from the original request ($scheme is http or https and $path includes the starting /)
Override Flarum No By default Rules are only run when Flarum encounters a 404 error to prevent slowing down the forum when rendering non-ruled routes. But if your rule also matches a route defined by Flarum or an extension, you'll need to enable this option to run the rule on every request. Be careful as you can lock yourself out of the forum if you match login or administrative routes !
Redirect is external No By default the Redirect To values gets the Flarum base url prepended to it. It's a safety feature that can prevent some unwanted redirects. But if you're using a different hostname on purpose as a redirect, you need to enable this option so your input is used as-it as the Location value for the redirect
Redirect Type 301 Choose the HTTP status to send along with the redirect. 301 indicates a permanent redirect and will be cached by browsers and search engines. 302 is a temporary redirect that won't be cached by browsers and usually has no meaning for search engines. Using 302 while testing your settings is easier as you won't have to clear your browser cache if something goes wrong.
Enable rule As the name suggests, this allows you to activate or disable a rule. A rule can only be activated once you set a Condition and a Redirect To value.

Please note that as Flarum beta7, any rule starting with /admin will only work for users with administrative privileges, because the redirect script can't run before the auth check there.

You can only redirect urls for domains that resolve to your Flarum installation. If you'd like to manage redirects from other domains, check your hosting dashboard or webserver documentation on how to add aliases.

Caching

The list of rules is saved to the cache so no additional database query is needed while running.

This list is cleared every time you edit the rules in the admin panel. If rules are not updating, you can try running php flarum cache:clear to clear the whole cache.

Examples

Condition: example.com

Matches https://example.com/, https://example.com/tags, http://example.com/?forum=1

Doesn't match https://forum.example.com/, https://example.net/

Condition: https://*.example.com

Matches https://forum.example.com/, https://www.example.com/forum

Doesn't match https://example.com/, http://test.example.com/

Condition: example.com/

Matches https://example.com/

Doesn't match https://example.com/tags

Condition: /forum

Matches https://www.example.com/forum, https://example.net/forum

Doesn't match https://example.com/admin

Real life examples

Redirect your forum to HTTPS

You need to enable Override Flarum for this rule.

Redirect from www. to apex

You need to enable Override Flarum for this rule.

Redirect an old forum homepage to Flarum

Redirect discussions from an old forum

Redirect unknown discussions to homepage

Rickroll every admin (including you)

You need to enable Override Flarum and Redirect is external for this rule.

PS: If you have not guessed it already, this will lock you out of the admin panel. You'll need to edit/delete the migratetoflarum-redirects.rules setting in your Flarum database to restore access to the admin panel.

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


All versions of redirects with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
flarum/core Version ^0.1.0-beta.7
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package migratetoflarum/redirects contains the following files

Loading the files please wait ....