I sent an email to some folks today with a link to a word document hosted on wordpress. The URL in the email is something like:
www.mycompany/media/2018/06/somedocument.docx
Unfortunately, somedocument.docx actaully resides at:
www.mycompany/media/2018/05/somedocument.docx
When people click the link in the email, they get a 404. We have tried a 301 redirect from one to the other, but that doesn't seem to work. I'm assuming that's because it's a direct link to a file and not a normal HTTP request?
We have already sent a follow-up email with the correct link, but we'd like to fix the issue as well so that when someone clicks the original link in the email, they get redirected to the actual document instead of a 404. Does anyone know how to accomplish this? Thanks.
I sent an email to some folks today with a link to a word document hosted on wordpress. The URL in the email is something like:
www.mycompany/media/2018/06/somedocument.docx
Unfortunately, somedocument.docx actaully resides at:
www.mycompany/media/2018/05/somedocument.docx
When people click the link in the email, they get a 404. We have tried a 301 redirect from one to the other, but that doesn't seem to work. I'm assuming that's because it's a direct link to a file and not a normal HTTP request?
We have already sent a follow-up email with the correct link, but we'd like to fix the issue as well so that when someone clicks the original link in the email, they get redirected to the actual document instead of a 404. Does anyone know how to accomplish this? Thanks.
Share Improve this question asked Jun 11, 2019 at 15:14 Adam RosenscruggsAdam Rosenscruggs 31 bronze badge 2- Do you have access to an .htaccess file?? – ChristopherJones Commented Jun 11, 2019 at 15:16
- I didn't think to check - I'm saying "I" here but really this is a colleague of mine. Let me grab the WP credentials and take a look myself, I'm sure we do. – Adam Rosenscruggs Commented Jun 11, 2019 at 15:19
1 Answer
Reset to default 0If you have access to the .htaccess file, a quick 301 redirect should fix that for yah!
Redirect 301 /media/2018/06/somedocument.docx https://www.mycompany/media/2018/05/somedocument.docx
(If you don't there are other ways to handle it inside the theme if you need to.)