These notes are a very pared down version of how to make a WordPress site in a subdirectory become the main domain site. I do this for my new client sites a couple of times a year. Perhaps not a full blog but more a jog, a memory jog (recipe) for the next time. Hope it helps anyone that does not need a long preamble.
Scenario:
Client has live html site (somesite.com)
and a new WordPress website is ready to go in a subdirectory (somesite.com/aWordpressSite)
Mission: Go-live
Domain (somesite.com) should direct to WordPress site instead of the html site.
Site visitor is unaware of the subdirectory AnotherWordpressSite
Clear your head, think through, prepare:
Read the WordPress Codex
Read this nice post
Read my post about 301 redirects. To make a list of pages use the Site Map Generator and download the urllist.txt.
Take the steps:
- WordPress Dashboard > Settings > General > Site address URL. Change your site’s root address (somesite.com).
- Copy (not cut) index.php file from the WordPress site (somesite.com/aWordpressSite/index.php) into the root directory (somesite.com/index.php)
- Edit that moved file to include the subdirectory (somesite.com/index.php)
Check it 2 or 3 times to make sure you did it right:
require('./aWordpressSite/wp-blog-header.php');
- Try viewing it
- Not ok? Resave Permalinks (Remember Admin login URL does change)
- Delete or change the name of index.html (remember to move the .html files to a new folder so they don’t get in the way)
- View site. Not ok? Move .htaccess to same place as copied index.php
- View site – don’t worry, it will be fine now.
SEO
- Set up redirects for old pages.
The old pages are going to bounce to 404 error page so set up 301 redirects for a better user experience (see 301 redirect troubleshooting, .htaccess invisible in Dreamweaver ) - Turn on SEO plugin if it is not already active.
Other plugins to check on while in the neighborhood: Backup and Security.