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?


1 Answer 1


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]
  • Is this what you wanted?? ^old-file.xml$ instead of ^old-file.pdf$
    – closetnoc
    Sep 24, 2014 at 15:53
  • Doesnt change the logic of what I ment, but yes, made a mistake :) Thanks.
    – Martijn
    Sep 25, 2014 at 7:06
  • I respect that. I just wanted to alert you to a mistake. We all make them! Cheers!!
    – closetnoc
    Sep 25, 2014 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, 2014 at 17:06

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .