Redirect behaving oddly on one site. BEWARE of conflicting redirects
-
******This issue has resolved itself and is for the benefit of other users**********
On one of my sites Leicester Property Insight, upon installing Rankmath, it deactivates our redirection plugin (https://en-gb.wordpress.org/plugins/redirection/) as Rankmath has the same functionality and it works on my other sites but not this one. When redirecting from /connectuk to a new domain, the redirect will redirect to this URL and a 404 page:
https://www.leicesterpropertyinsight.co.uk/a:3:s:8:url_from;s:0:;s:11:url_notfrom;s:0:;s:6:server;s:42:https:/www.leicesterpropertyinsight.co.ukI use an http to https plugin (https://wordpress.org/plugins/https-redirection/) and a range of other plugins.
When I deactivate Rankmath and reactivate the redirection plugin (first link), the redirect works.
When I disable the redirect and deactivate the plugin, reactivate Rankmath and check the redirect, it doesn’t work on Leicester Property Insight. The URL I’m redirecting to, and the Rankmath redirect does work on another site (same server).
When I deactivate all plugins, except for Rankmath (using the WordPress Health Check troubleshooting plugin: https://wordpress.org/plugins/health-check/), the redirect still doesn’t work.
I think the problem may be with how it is writing the HTAccess file…
****************Fixed it*************************
So, it’d be a shame to just delete this post after I spent the best part of an hour testing things whilst writing the post but the issue was nothing to do with Rankmath (again – the Rankmath Devs will remember my previous contact with them via the review haha) or my server or the site itself. It was entirely to do with having multiple redirects for the same URL (/connectuk) redirecting to different URLS.I’m not sure how I managed to create the conflicting redirects but the page we were being redirected to was the FIRST redirection I had set up (I’m not entirely sure how I managed to get the link as I simply don’t recognise it); I assume I had forgotten about the redirect and upon creating new redirects, they didn’t work and this was forgotten about too.
I suppose a bit of feedback we can take from this is to put an “if” statement into the code where, if there is already a redirect created, it’ll either throw up a warning or the most recent redirect would supercede and take priority over the old redirect, thus allowing a fallback URL to be used (rather than error 404 or homepage redirect as backup as set under general settings).
The page I need help with: [log in to see the link]
- The topic ‘Redirect behaving oddly on one site. BEWARE of conflicting redirects’ is closed to new replies.