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 |1 Answer
Reset to default 3If 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
RewriteCond %{REQUEST_FILENAME} !-f
– Rup Commented Aug 23, 2019 at 7:16