• Hey guys,

    Next week I will be moving my company from our old website over to our new WordPress website, which is also on a new host.

    On our old website, we have a folder called /images where we stored various image files that we use within our email templates. So I have tons of these old templates with source code that links to things like https://www.domain.com/images/logo.png or https://www.domain.com/images/facebook.png

    What I wanted to do with the new WordPress site was upload these same image files with those same URLs so that all my templates continue to work fine and I don’t have to alter any of the old source code.

    However, I can’t figure out a way to change the URLs of images in WordPress so that they go into a folder titled /images right after the domain.

    Is this possible?

    And if not, would it be OK for me to just create an /images folder on my server in the public_html section and store them outside of WordPress. Would this pose any security risks leaving a random folder of images in the public_html folder? Our old website keeps getting hacked and I’m trying to make sure the new website is locked down as strongly as possible.

    Any help is greatly appreciated, thanks!

    Best,

    Daniel

Viewing 6 replies - 1 through 6 (of 6 total)
  • I Googled around and found this:

    If the reason you’re redirecting is to conform to a new URL scheme, most web servers have an easy way to rewrite URLs on the server without having to send an actual redirect back to the client. In other words, the client may request /static/bar.jpg but the server can be configured to translate that into /media/images/bar.jpg. This URL-rewriting approach is preferable to redirection in most cases, since you can refactor where your content lives on the server without incurring the redirection overhead on the client or server side.

    Source: https://stackoverflow.com/questions/3778347/is-it-ok-to-http-redirect-images

    Hi Daniel,

    I asked one of our programmers and he said, “For legacy support just leave a folder of those old images and copy them into the Media Library for future use.” So, the answer to your question “would it be OK for me to just create an /images folder on my server in the public_html section and store them outside of WordPress” appears to be yes.

    Sincerely,

    Randy

    Thread Starter dmurphyca

    (@dmurphyca)

    Hi Randy,

    Thank you so much for the replies. I read through the stack overflow link but it was a bit over my head. Leaving an /images folder in my public_html section would certainly be the easiest solution. I just really want to ensure it’s secure. Glad to hear your input from your programmer.

    You’re more than welcome. And I agree, leaving an /images folder in your root folder will be the easiest fix for your situation. As for security, I am no expert but I cannot think of any reason not to. As long as permissions are set appropriately of course. In fact, I have done it myself on a couple of sites. Moreover, I just asked my programmer, about your security concerns, and he too said he couldn’t think of anything. ??

    Thread Starter dmurphyca

    (@dmurphyca)

    Thanks Randy!

    You’re very welcome!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Changing Image URLs’ is closed to new replies.