Download the PHP package alt-design/alt-redirect without Composer

On this page you can find all versions of the php package alt-design/alt-redirect. 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 alt-redirect

Alt Redirect

Ez pz redirects, simple, spicy and nicey.

Features

How to Install

You can search for this addon in the Tools > Addons section of the Statamic control panel and click install, or run the following command from your project root:

Basic usage

Simple redirects

Just take a request to one URL and redirect to a new url, for example

From :

To :

Regex redirects

These, other hand, allow much richer redirect functionality.
Lets say you changed a wildcard URL path to be a query parameter on a new page, this can done like so

From :

To :

the '$x' (where x is a number) elements are arranged in the order the corresponding '(.*)' appeared in the 'From' URL, this allows rearranging the regexed fields in the 'To' URL.

Headers on redirect

You can add headers to the redirect response using the addon's config file. To get started, publish the config file to your site:

In the headers property, you can provide an array of headers to be passed to the redirect method.

Query String Stripping

This is a new feature we've added to remove query strings from URIs before they're processed by the redirect middleware.

Because redirects are URI-based, an unexpected query string on a link would've cause your redirects to not function.

With this feature, you can strip out troublesome query strings before your redirects are processed.

Following this, you can choose to either add the query string back to the redirect URL, or strip it out entirely. The default behaviour for this is to add the filtered query strings back after the redirect has been found.

You can set a query string to be stripped using the "strip" toggle in the Query Strings admin panel.

The Query Strings functionality can be found in the nav as a child underneath the Alt Redirect Addon

On this page you can manage the query strings you wish to strip, simply :

You'll see your query string in the list.

Database Redirects

By default, the addon stores redirects and query strings as YAML files in content/alt-redirect/. For containerised deployments or larger sites, you may wish to store these in your database instead.

1. Publish Configuration

If you haven't already, publish the configuration file to your site:

2. Run Migrations

While migrations are loaded automatically, you can publish them if you wish to customize them:

Run the migrations to create the necessary tables:

3. Switch Driver

In your config/alt-redirect.php, change the driver from file to database:

4. Migrate Existing Data (Optional)

If you already have file-based redirects and want to move them to your database, you can use the following Artisan command:

The command will check if the required tables exist and then migrate all your redirects and query strings.

Artisan Command

We have provided an Artisan command to force the creation of defaults.

This will "force" create them, so they'll be installed even if the defaults have already been installed.

This is great for if you've deleted the defaults but want them back or if composer didn't install them during the addon install for some reason.

Simple run the command below and confirm when it asks you too :

Questions etc

Drop us a big shout-out if you have any questions, comments, or concerns. We're always looking to improve our addons, so if you have any feature requests, we'd love to hear them.

Also - check out our other Statamic bits!

Starter Kits

Addons

Postcardware

Send us a postcard from your hometown if you like this addon. We love getting mail from other cool peeps!

Alt Design
St Helens House
Derby
DE1 3EE
UK


All versions of alt-redirect with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
statamic/cms Version ^6.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 alt-design/alt-redirect contains the following files

Loading the files please wait ...