I've read the WordPress Codex instructions regarding moving WordPress, but none of the information provided seems to apply to my exact situation and I have a couple of questions before I go and break things. I have a main domain on which my old wordpress site is currently running (eg - example.com) I wanted to change the layout of the website but at the same time wanted to keep my main site running so made a subdomain (beta.example.com) and created my new wordpress website on this. Now I want to make my beta website the main website (ie make beta.example as example.com) and remove the main website, how do I go about that? I am using cpanel and both my folders are in the public html directory Thanks in advance.
Step 1: Backup: Always backup the files / database of the site(s) you choose to work with
Step 2: Move files: Delete the contents of example.com's document root and move the contents of blog.example.com to example.com
Step3: Change home/site-url: The daabase mght have other hard coded urls too. So changing the home / site url alone will not be enough and a full database search-replace is needed.
I would not recommend using notepad++ or any text editor to change the website url as it has a great chance to break the layout of the website and I have seen it may times happen. I always use and recommend you to use the Database Search and Replace Script
from here
Download the version 2.1.0 to the document root of the website as search.php
Now call the script via your browser (as domain.com/search.php). The script autopopulates the database details. The rest of the instructions there are self explanatory to follow.
Step 4: Finishing up: Check the .htaccess
file that there are no redirects to the blog.example or similar redirects. If yes, remove them and replace with the default .htaccess wordpress rules.
That should do it.
Steps are below:-
Thanks, I hopes it will work for you as example.com
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.