• Resolved tovk

    (@tovk)


    Greetings,

    here’s my situation:

    I duplicated my site (using the Duplicator plugin) and migrated it to a new domain. However the old site still exists and shares the same database with the new site. This is a problem because the old site takes space and slows down the new site.

    I added a redirection code in the old site’s .htaccess file to redirect visitors to the new site. What I want is to completely delete everything else from the old site except this redirection. I want to turn it into a one big redirection.

    The redirections work so that a visitor is redirected from the old site’s post X to the new site’s post X. I want to keep this and not for example redirect the visitor from old site’s post X to the new site’s front page only.

    Is there a way to achieve this? Can it be done via FTP? Which files to delete and how? I’m no too big of a wizard with these backend settings so all help is appreciated. The old site can be found here and the new one here.

    edit: The two domains have their own directories in the database’s root directory.

    • This topic was modified 7 years, 8 months ago by tovk.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi,

    You can setup 301 redirects.
    https://www.inboundnow.com/how-to-properly-set-up-wordpress-301-redirects/

    Hope this helps.

    Thank you

    Thread Starter tovk

    (@tovk)

    Greetings,

    thank you for the reply. That is not what I was asking, though, as I already have setup the 301 redirections. What I want is to delete everything else except the redirections. For example if I delete the old site’s whole directory via FTP then I’ll also lose the redirections.

    Or would it be possible to do just that (delete everything) then recreate the old site’s directory, reinstall wordpress and use some plugin to redo the redirections? The problem is that I want to keep all the specific redirections (for example from old site’s post X to new site’s post X) and not lose SEO.

    All help appreciated.

    yups just remove old website, just take a backup by zipping all the content. check if everything works for a day or two and then you can get rid of ziop file too.

    redirections given in old website will go to new URL if .htaccess file is there. so dont remove that file.

    Thread Starter tovk

    (@tovk)

    Thank you for the helpful reply.

    So I can just copy the old site’s .htaccess file, remove everything else from the old domain’s directory (via FTP), reinstall WordPress and then copy paste the old .htaccess file to replace the automatcally generated one? And after that all the specific redirections should work as before?

    If I understood the database’s role correctly there should also be duplicate content in the actual databse (accessible by phpMyadmin) after the site’s migration. Should I also purge the database to remove the old content or is there anything that might affect the redirections?

    Complicated!

    keep the folder of old website and .htacces file, rest all files related to old website can be removed.

    nothing else needs to be done as you mentioned new website is already online.

    when visitor try to access old website it will be redirected to .htaccess file of old website and then redirected to new URL’s.

    Thread Starter tovk

    (@tovk)

    Thank you for the reply.

    So if I understood correctly I’ll only need to keep two things: 1) the directory of the domain and 2) the .htaccees file which is inside that directory.

    So I can delete everthing else, including wp-admin, wp-content, wp-config.php, etc. — so everything goes except the .htaccess file?

    And everything in the actual database (accessibe by phpMyadmin) that is duplicate content I can also delete without affecting the new site or the redirections?

    Getting there!

    yes the directory for old website will have only one file .htaccess. it contains our redirect rules. rest all files in that folder can be removed, dont forget to take a backup in case something goes wrong.

    the database is being used by new website so it need to be there. new website and wordpress install that we have for it need to stay

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Two sites, one database – How to delete the other without losing redirections?’ is closed to new replies.