I’m running into a frustrating issue with redirects after migrating a site from WordPress to Webflow. The old WordPress site had thousands of articles and then image links — each with their own dedicated pages, and I’ve attempted to set up dynamic redirects to preserve SEO value.
All article links like these work fine
https://www.eta.co.uk/2016/09/16/crua-hybrid
redirects to
https://www.eta.co.uk/news/crua-hybrid
But then the image attachments like
https://www.eta.co.uk/2016/09/16/crua-hybrid/crua-hybrid-tent
should be redirecting to
https://www.eta.co.uk/news/crua-hybrid
as well, but sometimes does, and sometimes doesn’t.
In this case it goes to
https://www.eta.co.uk/news/crua-hybrid-tent
which results in a 404 as it is the ‘image’ part of the slug.
These are my setups and findings:
Example redirects added
/2010/(.*)/(.*)/(.*)/(.*)
→ /news/%3
/20(.*)/(.*)/(.*)/(.*)/(.*)
→ /news/%4
these were added after the main article redirects that seems to work fine
/20(.*)/(.*)/(.*)/(.*)
→ /news/%4
This works as expected for some cases:
/2010/09/16/target/miss
→/news/target
/2010/01/18/correct1/incorrect2
→/news/correct1
But it fails in other cases:
/2010/09/16/yes/no
→/news/no
/2010/01/18/correct-1/incorrect-2
→/news/incorrect-2
Strangely, this works:
/2010/01/18/correct-link-1/incorrect-2
→/news/correct-link-1
But this, which is only slightly different does not:
/2010/01/18/correct-1/incorrect-link-2
→/news/incorrect-link-2
I also tried using broader patterns to catch all years like this:
/19(.*)/(.*)/(.*)/(.*)/(.*)
→/news/%4
/20(.*)/(.*)/(.*)/(.*)/(.*)
→/news/%4
However, some years work while others don’t. For example:
/2000/01/18/correct-1/incorrect-link-2
→/news/correct-1
(works)/2001/01/18/correct-1/incorrect-link-2
→/news/correct-1
(works)/2003/01/18/correct-1/incorrect-link-2
→/news/incorrect-link-2
(2003 doesn’t work)
Is there something about Webflow’s redirect system or regex handling that explains this behaviour? I gather that it has something to do with the ‘-’ part of the links, but really can’t explain how some links even with ‘-’ or years work and others not.
Have also found, that even when using new incognito tabs in chrome and safari, that the same link might be a hit in one and a miss in the other.
We can’t add invidual redirects as there are thousands of these links and we are already on 1400 redirects which is over the recommended 1000. The migration has really been a bit of a 404 nightmare because of this issue.