Imagine you installed WordPress on a folder named ‘blog’ and you like it so much you want to use it as your main website. Meaning, you want anyone going to yoursite.com to land on the WordPress site. It is actually super easy to do and you don’t have to re-install or manually move the whole installation. This checklist walks you through the steps you need to take.
1. Prepare The Index File
- Download or copy the original index.php from WordPress onto your computer. If you want you can temporarily re-name it to wpindex.php.
- Open the file and edit the line that says require(‘…’) make sure this points to the right place in this example, WordPress is installed in /public_html/blog so you’ll want to make it require (‘blog/wp-blog-header.php’);
- If you installed WordPress in a folder with another name you will need to adjust the path accordingly
- Save this file
- Upload it to your /public_html/ or /www/ folder.
2. Log In To WordPress Admin
- Navigate to Settings >> General.
- One of the options there are WordPress Address and Blog Address.
- Change the Blog Address from http://www.yoursite.com/blog to http://www.yoursite.com
- Do not change the WordPress Address
3. Rename The Index
- Log in to your site via FTP or your web hosts’ file manager.
- Rename your existing index.html/index.php etc – whatever your home page is to another name – this will take your home page down.
- Rename wpindex.php (the file we edited and uploaded earlier) to index.php
4. Visit Your Website In A Browser
- Refresh so you will see the changes. If you don’t see it on the first refresh, try a couple of refreshes or clear your browser cache then visit your site again
- Your home page should now be the WordPress home page
Tip #1: You can use this same method to work in private mode. For example, if you have a live site and do not want to interfere with it, you can install it into a special folder and switch using the above steps when you’re ready.
Tip #2: You can also do this in reverse. For example, install WordPress in /public_html/ or /www/ folder then make it appear in /blog/ or /whateverfoldername/. Just follow the same steps.