Roots Discourse

Copy a site Wordpress into a subdirectory

  1. Hello,
  • I just got the Wordpress from a client wich was developped with Bedrock by another web agency. The site works well with a simple tree : config, vendor, www and the .env at the root directory and “www.ydomaine.fr” as a domain name.

  • My client wishes to have a development environment on www.ydomaine.fr/dev with the copy of the site. That’s why I made the following method :

    • I made a copy on /www/dev
    • I modified the .env :
    • WP_HOME=http://www.mydomaine.fr/dev/www
    • Add other prefixes : DB_PREFIX=sitedev_
    • I replaced all adresses of my base by :
  • But it doesn’t work : on the home page, the theme is not displayed and the login page redirects to the admin page.

  • Would you have any ideas to help me please ? Did I forget something ?

  • Thank you in advance for your help.

Are you able to use Trellis for your deploys? If so, I would suggest telling your client that the dev site will be at dev.mydomaine.fr, and then let Trellis handle all that for you. It’s honestly an amazing workflow - combine it with GitHub and you have the perfect system for handling multiple environments.

Hello,

Thanks a lot for your help. The website is currently on a shared server on OVH.

What is the best method to make a copy of the website ? Should I take another site hosting ? Should I take a subdomain ? Can’t I do a simple migration, just like another Wordpress ?

Thanks again in advance