• Resolved mirzakup

    (@mirzakup)


    Hi,

    I have a need to replace .pdf files every now and then. Which settings should I choose if I want to replace the existing file with a new name, but also redirect all the visitors of the old file to the new one?

    Old file path: domain.com/2020/02/filename_old.pdf
    New file path: domain.com/2020/02/filename_new.pdf

    Is there any way that if someone visits the old file gets redirected to the new one?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Gerard Blanco

    (@sixaxis)

    Hi @mirzakup,

    If you want to update the filename of a file, you can choose the option “Replace the file, use new file name and update all links”, but note that the visitors that visit the old URL will not be redirected to the new one. That’s not part of Enable Media Replace’s functionality.

    However, that’s very easy to do with a simple .htaccess rule: https://help.dreamhost.com/hc/en-us/articles/215747748-How-can-I-redirect-and-rewrite-my-URLs-with-an-htaccess-file-

    Cheers!

    Thread Starter mirzakup

    (@mirzakup)

    Hi @sixaxis

    Thank you for the clarification. I have expected that the plugin will make a redirection automatically and because of that, it was opening the old file. Anyway, creating the redirection manually helps.

    Cheers!

    Plugin Support Gerard Blanco

    (@sixaxis)

    Sure thing!

    This seems quite bizarre to me. So when the plugin offers ““Replace the file, use new file name and update all links” it doesn’t mean it? It means “I will wipe the old file, replacing it with the new name and I really, really WON’T update all links, in fact I won’t update any old links at all so they’ll all be broken so you probably really don’t want to do this”. Or it might say “I will wipe the old file, replacing it with the new name and I really, really WON’T update all links, in fact I won’t update any old links at all so they’ll all be broken so you probably really don’t want to do this unless you’re happy adding an .htaccess redirect rule to your site.” I will probably stay with the plugin but I think you need to change this and I’m very, very glad I experimented with a file I no longer needed in a sandbox site and didn’t just take that message at its face value!

    Plugin Support Gerard Blanco

    (@sixaxis)

    Hi @psyctc,

    I think I didn’t explain myself properly.

    If you choose to update the filename of a file, you can choose the option “Replace the file, use new file name and update all links”. That will replace all old links.

    However, you will agree with me that anyone can still access the old URL, right? I can go now and write it on the address bar on my browser. Or the old URL may be linked from a different website. It’s in these cases where, for obvious reasons, Enable Media Replace cannot “replace” the old URL and you will have to work an .htaccess redirection.

    I hope that clarifies it ??

    Best,

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘PDF File Replacement’ is closed to new replies.