{"id":15984887,"url":"https://github.com/divineomega/seo-middleware","last_synced_at":"2025-03-18T01:30:28.308Z","repository":{"id":56969731,"uuid":"56149195","full_name":"DivineOmega/SEO-Middleware","owner":"DivineOmega","description":"Middleware to redirect to HTTPS when in production, and remove www. from URLs","archived":false,"fork":false,"pushed_at":"2019-09-23T10:47:15.000Z","size":10,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-15T02:37:52.709Z","etag":null,"topics":["https-redirect","laravel-5-package","laravel-middleware","middleware","seo","seo-middleware"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DivineOmega.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-13T12:18:32.000Z","updated_at":"2022-01-12T14:26:45.000Z","dependencies_parsed_at":"2022-08-21T10:50:58.818Z","dependency_job_id":null,"html_url":"https://github.com/DivineOmega/SEO-Middleware","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivineOmega%2FSEO-Middleware","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivineOmega%2FSEO-Middleware/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivineOmega%2FSEO-Middleware/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivineOmega%2FSEO-Middleware/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DivineOmega","download_url":"https://codeload.github.com/DivineOmega/SEO-Middleware/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221703995,"owners_count":16866658,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["https-redirect","laravel-5-package","laravel-middleware","middleware","seo","seo-middleware"],"created_at":"2024-10-08T02:11:05.278Z","updated_at":"2024-10-27T16:25:18.611Z","avatar_url":"https://github.com/DivineOmega.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SEO Middleware\n\nThis package contains various middleware classes that can be uses with Laravel\n5.1 and above to easily add various SEO benefits to your site / web application.\n\n## Features\n\n* Redirecting production HTTP requests to HTTPS\n* Removal of `www.` from requests and redirecting\n* Middleware classes can be applied global or to specific routes\n\n## Quick Start\n\n1. Run `composer require divineomega/seo-middleware`.\n2. In the `$middleware` array in your `app/Http/Kernel.php` file:\n  * For HTTP to HTTPS redirects, add `\\DivineOmega\\SeoMiddleware\\Http\\Middleware\\HttpsOnly::class`.\n  * For removal of `www.` from requests, add `\\DivineOmega\\SeoMiddleware\\Http\\Middleware\\RemoveWww::class`.\n3. Remember to set the `APP_ENV` variable to `prod` (in the project's `.env` file) when the application is running in production. Some middleware will only function when this is set to allow for easier local development.\n\n## Available Middleware Classes\n\nAny of these middleware classes can be used globally, by adding them to\nthe `$middleware` array in `apps/Http/Kernel.php` file. They can also be used\non a per route basis, by adding them to the `$routeMiddleware` array in the\nsame file and then associated them with a route in your `apps/Http/routes.php`\nfile.\n\n### HttpsOnly Middleware\n\nThe `HttpsOnly` middleware will redirect any HTTP request to their HTTPS\nequivalents. The security of websites is becoming an ever increasing ranking\nsignal for search engine rankings.\n\nThe HTTP to HTTPS redirect will only take place if the application environment\nis set to `prod` (production), to aid with local development environments in\nthe setup of HTTPS can be difficult and in many cases unnecessary. Changing\nthis setting can be set in your project's `.env` file, as shown in the example\nextracts below.\n\n```\nAPP_ENV=local # Local development (redirect disabled)\n```\n\n```\nAPP_ENV=prod  # Production use (redirect enabled)\n```\n\n### RemoveWww Middleware\n\nThe `RemoveWww` middleware will check for `www.` within the URL of any requests\nmade to your web application and then redirect them to a version of the URL\nwithout the `www.` removed. This can be beneficial for SEO purposes by the\npotential for similar URLs to be indexed with the same content.\n\nThis redirect will occur regardless of the application environment (`APP_ENV`)\nsetting.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivineomega%2Fseo-middleware","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdivineomega%2Fseo-middleware","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivineomega%2Fseo-middleware/lists"}