Download the PHP package jorisnoo/statamic-locale-redirect without Composer

On this page you can find all versions of the php package jorisnoo/statamic-locale-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 statamic-locale-redirect

Statamic Locale Redirect

A Statamic addon that automatically redirects visitors from / to their locale-specific home route based on their browser language preferences.

Features

Requirements

Installation

That's it. The addon registers itself automatically via Laravel's package discovery.

How It Works

When a visitor hits your site's root URL (/), the middleware:

  1. Reads the Accept-Language header from the browser
  2. Fetches all configured Statamic site locales and their URLs
  3. Finds the best match between browser preferences and available locales
  4. Issues a 302 redirect to the matched locale's home URL

If no match is found, the visitor is redirected to the default site's URL (or a configured fallback). Query parameters are preserved through the redirect.

Configuration

The addon works out of the box with no configuration. To customize behavior, publish the config file:

This creates config/statamic/locale-redirect.php:

Exclude Locales

Prevent specific locales from being redirect targets:

Restrict to Specific Locales

Only allow redirection to specific locales. When set, only takes precedence over exclude:

Testing

License

The MIT License (MIT). Please see LICENSE for more information.

Maintainer releases

See RELEASING.md for versioning, changelog entries and the release command.


All versions of statamic-locale-redirect with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
statamic/cms Version ^5.0 || ^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 jorisnoo/statamic-locale-redirect contains the following files

Loading the files please wait ...