I have 6 PDF files that have been updated and will use a different file name. All files are in one folder. Old PDFs have been indexed in the search engines.

I saw one solution but I think it only works if you have one PDF per folder which is not the case here.


How do I make the switch to the new files?


Check if the old file is called, then change it to the new file

RewriteCond %{REQUEST_URI} ^old-file.pdf$
RewriteRule ^(.*) /new-file.pdf [L,R=301]
| improve this answer | |
  • Is this what you wanted?? ^old-file.xml$ instead of ^old-file.pdf$ – closetnoc Sep 24 '14 at 15:53
  • Doesnt change the logic of what I ment, but yes, made a mistake :) Thanks. – Martijn Sep 25 '14 at 7:06
  • I respect that. I just wanted to alert you to a mistake. We all make them! Cheers!! – closetnoc Sep 25 '14 at 9:26
  • I tried and it didn't work. Could it be because the file is not in root? The structure is like this: example.com/digital/2014/old.pdf (new.pdf is in the same folder) – dasickle Sep 25 '14 at 17:06

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.