nystudio107 / craft-retour

Retour allows you to intelligently redirect legacy URLs, so that you don't lose SEO value when rebuilding & restructuring a website
https://nystudio107.com/plugins/retour
Other
38 stars 26 forks source link

URL gives 404 but is not logged in dashboard #308

Closed svondervoort closed 3 months ago

svondervoort commented 5 months ago

Question

I'm not sure if this is a bug so I'm currently reporting this as a support request. We have a site setup with a lot of working redirects except for what it looks like one URL which is not being captured by Retour. The URL does show the 404 page but don't see it coming up in the dashboard.

I'm not sure what may be causing this since any suffix to the URL is not logged in Retour, but removing a few characters is.

http://ctouch-website.test/nl/oplossingen/educatie-hoger-onderwij // logged
http://ctouch-website.test/nl/oplossingen/educatie-hoger-onderwijs // not logged
http://ctouch-website.test/nl/oplossingen/educatie-hoger-onderwijs-test // not logged

Additional context

image image

khalwat commented 5 months ago

I tried to replicate the issue in my test environment, and was unable to. Which makes me think it is something specific to your local development, devops, or browser setup.

Screenshot 2024-06-25 at 10 35 45

My only guess here would be that the 404 is cached by your browser?

Also please provide the Craft version, Retour version, and any other additional information that might be helpful.

svondervoort commented 5 months ago

Yeah for some reason it only seems to happening for this specifiek (disabled and even deleted) entry and URL. I also created a new entry, disabled it and deleted it and Retour just registers the 404 hit and if I set a redirect on the 404 URL it just works.

Do you have any clue what could bypass Retour since it is showing up a 404 page?

Here are the versions if it helps:

It is happening on the server and also locally. Both environments run on NGINX so it isn't anything .htaccess related. Locally we work with Valet. CRAFT_ENVIRONMENT=production and CRAFT_DEV_MODE=false.

khalwat commented 5 months ago

Can you show me the Retour redirect you've created that might be capturing this URL? Is it possible it's using a regular expression that is capturing the redirect?

Are you able to reproduce it in another project, or is it specific to this project somehow?

svondervoort commented 5 months ago

We have the Sites set to Netherlands of which the Base URL is set to @web/nl. The Legacy Url Pattern is set to /oplossingen/educatie-hoger-onderwijs with the Legacy URL Match Type set to Path only.

We've also tried setting Sites the All and use Full URL with the complete URL but still we see the 404 instead of the page set in the redirect.

It also happens to other entries in a different section.

Is there any way to debug the 404 page? I tried other existing redirects which do work.

svondervoort commented 4 months ago

Just checking, is there any way to debug the 404 logic? Or should can we only debug using the advanced events?

khalwat commented 4 months ago

Yes, if devMode is enabled there should be extensive logging of 404 errors, and the general flow of things.

I'd suggest deleting all of your logs, ensuring that devMode is enabled, then recreate the problem, and then search the web.log for messages from Retour.

I'm also happy to look at said log if you like -- send it to info@nystudio107.com

khalwat commented 3 months ago

Closing this issue out -- happy to continue to help you figure out what's going on here tho.