最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

301 Redirect Link to Media

programmeradmin2浏览0评论

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
Add a comment  | 

1 Answer 1

Reset to default 0

If 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.)

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论