admin管理员组

文章数量:1415673

For some reason, Google has picked up a PDF version of one of our articles from wp-content and ranked it for one of our higher-value keywords. I'm looking to redirect that PDF link to a link for the original article, but I can't seem to get the Redirect plugin working for the wp-content URL.

If you have any ideas for how I could redirect from the wp-content PDF url to the original article URL, I'd really appreciate it. Thanks!

For some reason, Google has picked up a PDF version of one of our articles from wp-content and ranked it for one of our higher-value keywords. I'm looking to redirect that PDF link to a link for the original article, but I can't seem to get the Redirect plugin working for the wp-content URL.

If you have any ideas for how I could redirect from the wp-content PDF url to the original article URL, I'd really appreciate it. Thanks!

Share Improve this question asked Aug 22, 2019 at 23:34 Aaron MarsdenAaron Marsden 1011 bronze badge 1
  • That's because the request is served directly from disk if it exists as a file, and only given to WordPress to process if the path doesn't match a file or directory. The usual Apache config for this is RewriteCond %{REQUEST_FILENAME} !-f – Rup Commented Aug 23, 2019 at 7:16
Add a comment  | 

1 Answer 1

Reset to default 3

If you have access to your .htaccess file, try the following RewriteEngine On RewriteRule ^(Your_Artile_Name)\.pdf your_article.php [L,R=301] Substituting your actual file names for 'Your_article_name' and 'your_article'.

If you have a Microsoft server, this article explains how to convert .htaccess to web.config

本文标签: redirectRedirecting from wpcontent