GitXplorerGitXplorer
O

domain-enforcement

public
23 stars
5 forks
0 issues

Commits

List of commits on branch master.
Verified
9ef57e4ebb1b9895fe6b5e82ff428ae88b74c081

Update composer.json

OOwenMelbz committed 5 years ago
Verified
9a68b6f08a2629e9385fbae95ec371e18874602a

Update README.md

OOwenMelbz committed 5 years ago
Verified
d5fbe4acea7ad428566a313249d5e76437c2d84b

Update README.md

OOwenMelbz committed 5 years ago
Verified
b98fede03c59a29af545af064e6b8f87f64ac467

Update composer.json

OOwenMelbz committed 5 years ago
Unverified
7ee6e757f043b428d7ed2ea49bffadec0538e73e

Merge branch 'master' of ssh://github.com/OwenMelbz/domain-enforcement

OOwenMelbz committed 7 years ago
Unverified
52a30992eb35b17664c5c23da7bb208a7c9af4a2

added fallback for laravel 5.1

OOwenMelbz committed 7 years ago

README

The README file for this repository.

Laravel 5+ Domain / APP_URL Enforcement

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

  1. Install via composer composer require owenmelbz/domain-enforcement

  2. Register the service provider - typically done inside the app.php providers array e.g OwenMelbz\DomainEnforcement\DomainEnforcementServiceProvider::class

  3. Add ENFORCE_DOMAIN=true to your application environment config e.g .env

  4. 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.