I hope everyone is well.
I am having a few issues trying to redirect an image that was linked in error from an email to a html page.
For example the email points here – https://www.caravanguard.co.uk/news/wp-content/uploads/2021/03/Swift-Vogue-580-1.jpeg
But should point here – https://www.caravanguard.co.uk/news/make-mine-a-dealer-special-caravan-25644/
I have appplied the following to our .htaccess, but it does not appear to have worked. I have also done the same in the wordpress yoast plugin we use.
redirect 301 /news/wp-content/uploads/2021/03/Swift-Vogue-580-1.jpeg /news/make-mine-a-dealer-special-caravan-25644/
Any ideas?
3
Answers
Had to remove the image from wordpress before it would allow the redirect to work. WP rules seem to have got in the way. The .htaccess rule I originally created then kicked in.
I tried the above comments prior to the deletion and they did not work. Cheers for your help both.
You can use a
RewriteRule
Make sure this rule is at the top of your htaccess or before your WordPress rules.
With your shown samples, could you please try following. Please make sure to place these rules at top of your .htaccess file. Also please do clear your browser cache before testing any URLs.