laravelir/redirector

a redirector package

v0.4.6 2022-03-25 11:38 UTC

This package is auto-updated.

Last update: 2024-12-09 06:10:25 UTC


README

Starts Forks Total Downloads

laravel Package

A redirector package

Seo Toolkit for laravel projects

Installation

  1. Run the command below to add this package:
composer require laravelir/redirector
  1. Open your config/app.php and add the following to the providers/aliases array:
Laravelir\Redirector\Providers\RedirectorServiceProvider::class, # provider
'Redirector' => Laravelir\Redirector\Facades\Redirector::class # aliases
  1. Run the command below to install package:
php artisan redirector:install

Features

for redirector service add this middleware

'redirector => \Laravelir\Redirector\Http\Middleware\RedirectorMiddleware::class,

for enforce https this middleware

'enforce_https' => \Laravelir\Redirector\Http\Middleware\RedirectorEnforceHttps::class,

add this to env:

REDIRECTOR_ENFORCE_HTTPS=true

Redirector Service

use Laravelir\Redirector\Services;

$redirector = resolve(Redirector::class);

$redirector->store($source_url, $destination_url, $response_code);
$redirector->shouldRedirect(Request $request);
$redirector->redirect(Request $request);

Goals of this package (Todo)

1 -
2 - redirect 404 pages to exist page

enable/disable www to non-www

add slashed to end of all routes or remove it

force redirect http to https in htaccess and nginx

add route hit counter

implements features of wordpress plugins like redirect-301, SEO Redirection Premium, safe-redirect-manager, Yoast seo Pro, Rank Math

add redis - file - Mysql - Mongodb engine Repository

add redirect ro lower

abort index.php page to 404

add exclude urls for redirects

add wildcard params (Regular Expression Constraints)

add url shortener

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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