Install WordPress files to a Subdirectory but Run your Blog off the Root Directory
At TechCounter, the WordPress files are installed to a Subdirectory? So you ask the question, how can I access your blog at http://www.techcounter.com and not at techcounter <dot> com/subdirectory.
Many people like you want to WordPress to run of their site’s root directory ( e.x http://yoursite.com ) but don’t want all of the WordPress files cluttering up their root directory. In this article, I will tell you how to Install WordPress files to a subdirectory, but run your blog off your site’s root directory.
1. Create the new location for the core WordPress files to be stored (we will use /myblog in our examples).
2. Go to the Options panel in your WordPress Dashboard. Go to General tab
3. In the box for WordPress address (URL): change the address to the new location of your main WordPress core files. Example: http://yoursite.com/myblog
4. In the box for Blog address (URL): change the address to the root directory’s URL. Example: http://yoursite.com

5. Click Update Options
6. Move your WordPress core files to the new location (myblog address).
7. Copy the index.php and .htaccess files from the WordPress directory into the root directory of your site (yoursite address).
8. Open your root directory’s index.php file in a text editor
9. Change the following and save the file. Change the line that says:
require(’./wp-blog-header.php’);
to the following, using your directory name for the WordPress core files:
require(’./myblog/wp-blog-header.php’);
10. Login to the new location. It might now be http://yoursite.com/myblog/wp-admin/
11. If you have set up Permalinks, go to the Permalinks panel and update your Permalink structure. WordPress will automatically update your .htaccess file if it has the appropriate file permissions. If WordPress can’t write to your .htaccess file, it will display the new rewrite rules to you, which you should manually copy into your .htaccess file (in the same directory as the main index.php file.)
If you liked this article, click here to buy me a coffee!Popularity: 20% [?]


March 31st, 2009 at 2:20 pm
Can two WordPress installations run under a same domain? One in the root and the other in the /blog/ directory? I have the one installed in the root, and not when I try to install the second one - that is in the /blog/ I get an 404 error from the first (root) one.
Can I install the two somehow?
March 31st, 2009 at 10:03 pm
Ммм, где ещё можно такие творения увидеть?
July 4th, 2009 at 1:24 pm
Да уж… Тут как говорят люди: Азбуку учат — во всю избу кричат
August 20th, 2009 at 6:15 pm
Тут уже столько написали комментов до меня. Осталось только присоединиться.
December 16th, 2009 at 7:17 pm
Hi, I found your web site when i was searching Google for web sites related to this content. I must tell you, your site is good. I like the theme too, its pleasing. I dont have the time now to fully read your web site but I have bookmarked it and I also signed up for your RSS feed. I will be back in a night or two. Thanks for an informative blog.