0

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!

  • 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 Aug 23 at 7:16
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.