close

Where do you want to go

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

Check the require line in your file. Be sure that the / are in the right place and that the subdirectory name is correct. Most people make a mistake and either don’t edit the require line and put their subdirectory name in it or make a mistake with the syntax and have an extra slash, no slash, an extra period, etc.

Next, where did you put this index.php file? Some people have put it in the root of the hosting account instead of in the domain root — which is the public_html folder on most hosts. If you moved this file outside the public_html folder, that won’t work. Some people’s hosting accounts are really wildly configured, and their host does not have a straight forward path for you to figure out where the heck your domain root is. So, to keep things simple, you would have wanted to move the index.php to the directory just above your subdirectory that contains the WordPress application.

Finally, some people have inadvertently moved the index.php file in their theme’s folder rather than the index.php file in the subdirectory. If you don’t see the require line above in your index.php file, then you moved the wrong file.

2 – WordPress General Settings

The next most common mistake is to not set the General Settings in the WordPress Dashboard correctly. Here is how they should have been set:

If a mistake was made here, then you might not be able to see your site or you won’t be able to login to your site. It is pretty common to have made a mistake with these settings or forgotten to make the change here. To fix this, you will need to login to your phpMyAdmin application via your web hosting control panel. Take note of your database username and password in the wp-config.php file and check the following:

Login to the database and go to the wp_options table and click the browse tab.

The first option is is for siteurl (which is totally inconsistent with the General Settings field label). This should be set to the URL with the subdirectory:

Go to the next page of the table and check the home value. This should be the URL to the main site URL without the subdirectory name:

3 – .htaccess

Some web hosts will have issues with the .htaccess commands once your index.php file is in the public_html file. If this is the case, you should still be able to login to WordPress via the subdirectory, and your home page will display correct BUT your links to the other pages will show a “Page Not Found” error. (Please note: even though you are showing the pages of your site from the main domain url, you will still need to login via the subdirectory url – e.g. – and all of your images on the site will still be located in the

    

    

Whether you had an old .html site up or had your current WordPress site in the subdirectory indexed by Google, you’ll want to do redirects on these pages that Google may have indexed.

If you had an old .html site and the WordPress site was “private,” after you’ve completed this process, be sure to change the Privacy settings in the WordPress dashboard, so Google can now index these new WordPress urls. Install the and create redirects on the old .html URLs to their new WordPress URLs. Install the and generate a new sitemap and submit it to Google Webmaster Tools. This will help prevent any 404 Page Not Found errors. Google will eventually re-index your site with the new URLs, so you shouldn’t have those old URLs come up in search engine searches after a few weeks.

If your current WordPress installation was indexed by Google with the old URLs, eg and now it is then you will need to do the same as above for those old URLs. If you have a LOT of these old URLs, ie, you had a large, active blog before you followed these instructions, I’m testing out an .htaccess command you can use to rewrite all the URLs. I’ll post it here when I’ve tortured tested it.

7 – Protecting the WordPress Directory from Browsing

Since we removed the index.php file from the WordPress directory, now that directory can be “browsed,” which is not good. To prevent this, add the following line to your .htaccess file:

Options All -Indexes

OR create a new blank index.php file in the WordPress directory which contains the following code:

<?php

Previous     Next


TAGS


CATEGORIES

.