laminas / getlaminas.org

getlaminas.org source code
https://getlaminas.org
BSD 3-Clause "New" or "Revised" License
67 stars 23 forks source link

redirect with 301 the non-existing routes #191

Closed arhimede closed 4 days ago

arhimede commented 1 month ago

Bug Report

Q A
Version(s) x.y.z

Summary

https://getlaminas.org/about/%C2%A0 Indexed in google SERP

Current behavior

display error message

How to reproduce

Expected behavior

redirect with 301 to index page

froschdesign commented 1 month ago

"301 - Moved Permanently" for non-existing pages?

https://getlaminas.org/404

arhimede commented 1 month ago

"301 - Moved Permanently" for non-existing pages?

Yes, as there are few non-existing pages already indexed in google, and we need them removed from there.

So either a 301 redirect to index OR a 404 blank no-content page

froschdesign commented 1 month ago

If the page does not exist, then 404. (What did not exist before cannot be moved afterwards. 😉)


I suggest a nice and funny 404 page. 😃

Ocramius commented 1 month ago

It's more about directing pre-existing search results to the right ones: aliases, if you wish to call them that.

arhimede commented 1 month ago

The issue is not specific to getlaminas.org codebase. Can be triggered in dotkernel/frontend too .

Any call to $this->url() in a template, on a non-existent route , will crash

Xerkus commented 1 month ago

Good. Crash and burn and fix promptly

arhimede commented 1 month ago

there is a quick fix for getlaminas.org codebase , but will not address the main issue, which is in mezzio-helpers https://github.com/mezzio/mezzio-helpers/blob/5.17.x/src/UrlHelper.php#L157

Will be a PR at mezzio-helpers soon