• guinnesschoir

    (@guinnesschoir)


    A website has been converted to wordpress by a developer. That’s great, but as an occasional maintainer there is some old content I now want to refer to. It’s in an old http folder, but the site is now on https using simpleSSL. I don’t know how to create links to the old files. At the moment I am, one by one, re-uploading each file to the media library, which slugifies the name, and changing the link to the new file. But Google has years of links to the old http filenames. How can I continue to serve them, or is that all lost now?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Faisal Ahammad

    (@faisalahammad)

    If the old HTTP files still exist on your server, you can create redirects from the old URLs to the new ones using a .htaccess file. Here’s an example:

    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^http-folder/(.*)$ https://your-domain.com/$1 [R=301,L]

    This code will redirect any requests for URLs starting with http-folder/ to the equivalent URL on your HTTPS domain. For example, https://your-domain.com/http-folder/my-old-file.html would redirect to https://your-domain.com/my-old-file.html.

    You can modify this code to match the specific structure of your old URLs. You can also use a plugin like Redirection to manage your redirects easily.

    Setting up these redirects is essential, as failing to do so will result in broken links and lost traffic. By redirecting the old URLs to the new ones, you can preserve the value of any inbound links and maintain your site’s SEO ranking.

    Thread Starter guinnesschoir

    (@guinnesschoir)

    Thank you. The site already redirects http to https for existing files. My question is, if the https file or folder does not exist, can it fall back to the old http folder?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to keep links to old static pages and media?’ is closed to new replies.