Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have some PDF documents that I offer users once they have subscribed to my newsletter. Well, Google found them, and other people are posting them on various sites.

I'd like to take advantage of Google ranking my PDF documents and redirect users that click on those links to an html or php page.

How do you automatically redirect hotlinked PDF clicks (on Google search and other sites) to a relevant page (i.e. domain.com/PDFdoc1.pdf redirects to domain.com/PDFdoc1.html or domain.com/PDFdoc1/)?

I want to keep the PDFs ranked where they are on Google, and keep the PDF documents exactly where they are on my site, but just redirect hotlinked clickers to a page instead of the PDF.How can this be done?

share|improve this question

You should edit your (or create a) .htaccess file to allow for hotlink protection.

I would recommend using this tool: http://www.htaccesstools.com/hotlink-protection/

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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