kmlpandey77/laravel-redirection 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kmlpandey77/laravel-redirection

最新稳定版本:v1.0.4

Composer 安装命令:

composer require kmlpandey77/laravel-redirection

包简介

This package design for redirect 404 page to new link

README 文档

README

This package design for redirects missing (404) URLs to new URLs.

When redesigning an old site into a new one your URLs may change. If your old site URLs were popular you probably want to retain your SEO worth. One way of doing this is by providing permanent redirects from your old URLs to your new URLs.

A package for handling redirects via database.

Example

From example.com/non-existing-page to example.com/existing-page

From example.com/old-page to example.com/new-page

From example.com/old/about-us to example.com/new/about-us

Installation

You can install the package via composer.

composer require kmlpandey77/laravel-redirection

The package will automatically register itself.

Next you must register the \Kmlpandey77\Redirection\Http\Middleware\Redirector middleware:

// app/Http/Kernel.php

protected $middleware = [
    ...
    \Kmlpandey77\Redirection\Http\Middleware\Redirector::class,
];

Publish the config file with:

php artisan vendor:publish --provider="Kmlpandey77\Redirection\RedirectionServiceProvider" --tag="config"

You can create the redirections table by running:

php artisan migrate

Usage

You just have to add an entry to the redirects links in the database by using example.com/admin/redirects. And you can change route link, prifix, and middleware in config

return [
    /**
     * By defult route is `admin`
     *
     */
    'prefix' => 'admin',

    /**
     * Defining middleware for route
     */

    'middleware' => [
        'web',
        // 'auth' // or admin
    ],

    /**
     *
     */
    'route_link' => 'redirects'
];

Changelog

Credits

License

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

统计信息

  • 总下载量: 1.32k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-02-03