定制 pendalf89/yii2-redirect 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

pendalf89/yii2-redirect

最新稳定版本:1.0.3

Composer 安装命令:

composer require pendalf89/yii2-redirect

包简介

Component for convenient URL redirects in Yii2.

README 文档

README

Component for convenient URL redirects in Yii2.

Features

  • All redirects are stored in the DB
  • Fast speed
  • Easy installation and usage

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require pendalf89/yii2-redirect

or add

"pendalf89/yii2-redirect": "^1.0.0"

to the require section of your composer.json file.

Create table in your database (MySQL, Postgres etc.)

CREATE TABLE `redirect` (
    `source` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
    `target` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
    `created_at` datetime NOT NULL,
    PRIMARY KEY (`source`) USING BTREE,
    KEY `created_at` (`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

Configuration:

'on beforeRequest' => function() {
    Yii::$app->redirect->run();
},
'components' => [
    'redirect' => 'pendalf89\redirect\Redirect',
],

Installation done.

Usage

Just add your urls to DB:

Yii::$app->redirect->add('https://example.com/from/', 'https://example.com/to/');

After that the redirects will work.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-11-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固