定制 ymigval/laravel-wwwprotocolresolver 二次开发

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

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

ymigval/laravel-wwwprotocolresolver

最新稳定版本:v1.0.1

Composer 安装命令:

composer require ymigval/laravel-wwwprotocolresolver

包简介

A Laravel package for redirecting responses with or without www and with the specified protocol (http or https).

README 文档

README

The "laravel-wwwprotocolresolver" package provides easy configuration for redirecting responses with or without "www" and with the specified protocol (http or https) in Laravel applications. You can customize the redirection type (permanent or temporary), scheme (http or https), and redirection mode (with or without "www") according to your needs.

Installation

To install the package, run the following command in your Laravel project's terminal:

composer require ymigval/laravel-wwwprotocolresolver

Publish configuration file (optional)

If you want to customize the package configuration, you can publish the configuration file using the following command:

php artisan vendor:publish --tag="wwwprotocolresolver"

Usage

To use the package, simply add the following environment variables to your .env file:

# Supported: "http", "https"
WWW_PROTOCOL_RESOLVER_USE=https

# Supported: "with_www", "without_www"
WWW_PROTOCOL_RESOLVER_MODE=with_www

Ensure that you set these configurations only in production environments to avoid unwanted redirections during development.

Configuration

You can adjust the package configuration in the config/wwwprotocolresolver.php file. Here, you can define the redirection type (301 or 302), scheme (http or https), and redirection mode (with or without "www") according to your preferences.

return [
    'type' => env('WWW_PROTOCOL_RESOLVER_TYPE', 301),
    'use' => env('WWW_PROTOCOL_RESOLVER_USE'),
    'mode' => env('WWW_PROTOCOL_RESOLVER_MODE'),
];

This package allows you to enhance the security and consistency of your URLs by ensuring that all users are redirected to the preferred version of your website.

Changelog

Please refer to the CHANGELOG for more information about recent changes.

License

The MIT License (MIT). For more information, please see the License File.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-01-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固