If you previously installed WordPress into a subdirectory or subdomain but would now like to start using WordPress for the main part of your site, you have two options. You can either move WordPress from the subdomain or subdirectory into the document root of your site or you can reconfigure WordPress to run for the main part of the site but keep the files in that subdomain or subdirectory folder. In this article we'll show you the changes needed to keep most of the WordPress files in their existing folder, but use WordPress for the main part of your site.

  1. Begin by logging into your WordPress dashboard.
  2. In the WordPress menu (on the left side of the page) navigate to Settings > General and change the Site Address (URL) to your main domain name (e.g. http://yourdomain.com). Leave the WordPRess Address (URL) as it is, it should not be changed. Click the Save Changes button at the bottom of the page. Don't worry if you see an error message, and do not try to view your site just yet (you'll likely get an error message there too).
  3. Log out of your WordPress dashboard.
  4. Using either the cPanel File Manager or a stand alone FTP program, COPY the index.php and .htaccess files from the subdomain or subdirectory into the site's document root folder. This will be public_html for the account's main domain name, while Addon domains be something similar to public_html/addondomain.com. Make sure you copy these files, do not move them.
  5. In the cPanel FIle Manager, open your index.php file that you just moved to public_html to edit it. You can open the file for editing by clicking on the file and then selecting Code Edit or Edit in the menu at the top of the page or right clicking the file and selecting either Code Edit or Edit in the menu that appears. If you receive an Encoding Check pop up window, make sure utf-8 is selected as the character encoding.
  6. Near the end of the file, locate the line that reads:

    require('./wp-blog-header.php');

  7. Edit this to point to the directory where you originally installed WordPress (e.g. /blog/wp-blog-header.php:

    require('./blog/wp-blog-header.php');

  8. Now you're ready to log back into your WordPress dashboard once again. The link to wp-admin will not change from the original (e.g. blog.yourdomain.com/wp-admin or yourdomain.com/blog/wp-admin).
  9. If you are using Permalinks, navigate to Settings > Permalinks. Change your Permalinks to any other setting and click the Save Changes button. Now change them back to your preferred Permalinks structure and click Save Changes again. This will reset your Permalinks so all of your site's links should be updated now.

Now you can navigate to your domain name in your browser and see that it's now showing your WordPress site.

Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve our Help Center:
Email Address
Optional, but our team may contact you for more information.
Did you find this article helpful?

Post a Comment

Name:
Email Address:
Comment:
Are you a bot?
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

News / Announcements

Update to SSL Certificates - Certificate Warnings
1969-12-31 11:00 am EST
Hits: 681

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!

Help Center Search

Current Customers

Email: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.