owenmelbz/domain-enforcement
Composer 安装命令:
composer require owenmelbz/domain-enforcement
包简介
Laravel 5+ middleware to enforce a single domain on your application. e.g non-www. to www.
README 文档
README
An automatic piece of middleware for Laravel 5+, which will force users to access your application via what is defined in the APP_URL - especially useful for SEO forcing non-www users to www etc, unless specified in the ignore list
Usage
-
Install via composer
composer require owenmelbz/domain-enforcement -
Register the service provider - typically done inside the
app.phpproviders array e.gOwenMelbz\DomainEnforcement\DomainEnforcementServiceProvider::class -
Add
ENFORCE_DOMAIN=trueto your application environment config e.g.env -
Enjoy your stress free architecture agnostic redirects
Configuration
If you publish the config via php artisan vendor:publish --provider="OwenMelbz\DomainEnforcement\DomainEnforcementServiceProvider" you can exclude urls from getting enforced.
Why?
Too often we've wasted time configuring redirections, with proxy systems like CloudFlare, with apache development machines and nginx production, this removes all the headache and can simply be turned off and on at a whim.
统计信息
- 总下载量: 4.88k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 23
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-05-26