I've discovered an unwanted behaviour in one of my projects. This was not used to be so, Google indexed a url with index.php in it and gave a duplicate canonical notification. It happend on a URL like this: https: https: After I noticed it, I want to other known Laravel projects and discovered the same. https: https: And also on the Laravel website self.

removeIndexPhpFromUrl(); } protected function removeIndexPhpFromUrl() { if (Str::contains(request()->getRequestUri(), '/index.php/')) { $url = str_replace('index.php/', '', request()->getRequestUri()); if (strlen($url) > 0) { header("Location: $url", true, 301); exit; }} }}
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners