ethercreative / seo

SEO utilities including a unique field type, sitemap & redirect manager
MIT License
276 stars 95 forks source link

All redirects return 404 #419

Closed sergeyzozulya closed 2 years ago

sergeyzozulya commented 2 years ago

Description

I have to servers: dev and production Both servers running Nginx and configured the same On deve server redirects work fine, on production - don't

Steps to reproduce

  1. Setup permanent redirect from /privacysm to /privacy (I tried everything including regexps)
  2. Visit www.example.com/privacysm page
  3. Get 404 instead of being redirected

Additional info

alexjcollins commented 2 years ago

Hey @sergeyzozulya - are you definitely sure going to /privacysm on production is returning a 404? Is the data on dev identical to production (i.e. is your redirect on production, too)?

The way the SEO plugin redirects work is that when Craft returns a 404, it then looks up the redirect table to see if there are any redirects that match the request uri and then pass them off to the destination url.

sergeyzozulya commented 2 years ago

Database is 100% the same, prod environment is Ubuntu and local in Mac but the services are the same. I'll try to debug and check if your plugin gets control on 404.

sergeyzozulya commented 2 years ago

For some reason, the $path variable passed to findRedirectByPath function inside RedirectsService.php contains "privacysm?q=/privacysm&" instead of "/privacysm". This is very strange and seems nothing to do with your plugin. The issue can be closed.

alexjcollins commented 2 years ago

Thanks for getting back to me @sergeyzozulya That is odd! I hope you manage to figure it out.

sergeyzozulya commented 2 years ago

thanks @alexjcollins this is a kind of nginx misconfiguration i quess