Download the PHP package settermjd/redirect-to-new-domain-middleware without Composer

On this page you can find all versions of the php package settermjd/redirect-to-new-domain-middleware. 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 redirect-to-new-domain-middleware

Redirect to new domain middleware

This is a small piece of PSR-15 (HTTP Server Request Handlers) middleware that redirects a request from one domain to a new one; such as an old one that's being deprecated to a new one when a site is being re-hosted.

Prerequisites

To use the package, you'll need the following:

Getting Started

With Mezzio

To use the project, in a Mezzio application, you first need to provide it with the configuration that it needs. If you use RedirectToNewDomainMiddlewareFactory to instantiate it, which is the default option, it will look in the $_ENV superglobal first, then in the application's configuration array.

A sample configuration is available in config/sample.redirecttonewdomainmiddleware.global.php. Copy that to config/autoload, renaming it to redirecttonewdomainmiddleware.global.php. Then, update the values for the old and new keys to the required values for your application. These values are:

Then, for all routes that need the functionality, load the middleware as early in the route's pipeline as possible. This will ensure that the redirect happens before any other functionality is invoked. For example, in a ConfigProvider class, you could define a route as follows:

Alternatively, add the middleware to the global pipeline in config/pipeline.php as early as possible, such as in the following example:

You should not need to do anything else, as RedirectToNewDomainMiddleware will be registered with the application's DI container via the package's ConfigProvider class, which is automatically loaded when the package is installed into a Mezzio application.

Contributing

If you want to contribute to the project, whether you have found issues with it or just want to improve it, here's how:

Did You Find The Project Useful?

If the project was useful and you want to say thank you and/or support its active development, here's how:

Disclaimer

No warranty expressed or implied. Software is as is.


All versions of redirect-to-new-domain-middleware with dependencies

PHP Build Version
Package Version
Requires laminas/laminas-component-installer Version ^3.5
laminas/laminas-diactoros Version ^3.5
psr/http-server-handler Version ^1.0
psr/http-server-middleware Version ^1.0
psr/log Version ^3.0
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 settermjd/redirect-to-new-domain-middleware contains the following files

Loading the files please wait ...