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

Move Wordpress to a subdirectory

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: 23% [?]

Share This | Trackback URL | Comments feed for this post


21 Responses to “Install WordPress files to a Subdirectory but Run your Blog off the Root Directory”

  1. 1
    Ivan | SEO Consultant.ie Says:

    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?

  2. 2
    Meveontof Says:

    Ммм, где ещё можно такие творения увидеть?

  3. 3
    Руслан Says:

    Да уж… Тут как говорят люди: Азбуку учат — во всю избу кричат :)

  4. 4
    кyкyшка Says:

    Тут уже столько написали комментов до меня. Осталось только присоединиться.

  5. 5
    Ahmed Basuki Says:

    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.

  6. 6
    Crazy Says:

    Nice and useful article…thnx… :)

  7. 7
    Shanika Ibbetson Says:

    30. Hi, your article is very instructive and I actually like the content material where in every element is extremely important. By some means, it gives me more knowledge about issues that is happening nowadays.

  8. 8
    car battery Says:

    Thanks. I’d been wondering about how to tackle this issue in WP myself recently.

  9. 9
    Transistor : Says:

    home security should be the first priority of everyone because we should always protect our assets**.

  10. 10
    Cotton Comforter Sets %0A Says:

    there are lots of cheap home security gadgets that you can buy online these days, i can find most of them from ebay **`

  11. 11
    document archiving software Says:

    Thanks for it, a very good post !

  12. 12
    Irvin Hagopian Says:

    This is really my first time here, great looking blog. I found so many interesting things in your blog especially its discussion. From all the remarks on your articles, it appears such as this is often a extremely popular website. Continue the great work.

  13. 13
    Luxury Rentals Says:

    I like the theme too, its pleasing. I don�t have the time now to fully read your web site but I have bookmarked it and I also signed up for your RSS feed.

  14. 14
    Luxury Rentals Says:

    WordPress will automatically update your .htaccess file if it has the appropriate file permissions.

  15. 15
    tire Says:

    It’s pretty nice how you are able to customize wordpress like that!

    -Jean

  16. 16
    what is a hemroid Says:

    Fantastic website, partner! Install WordPress files to a Subdirectory but Run your Blog off the Root Directory | TechCounter - TechNews, Money & SEO is absolutely a thing. I’ll be starting my own quickly and i also will certainly replicate aspects of your own, lawfully naturally :)

  17. 17
    pornfucky Says:

    Your site was very nice

  18. 18
    Lillian Cagno Says:

    Nice Finding. It will be useful to everyone who will be able to use this information, including myself. Keep up the good work.

  19. 19
    Liza Krinov Says:

    I am glad to be a visitor of this gross web site, regards for this rare info!

  20. 20
    Addison Says:

    Hey great write-up , Thank you for giving this information

  21. 21
    top plugins Says:

    Can I take advantage of a number of Search engine optimization plugins for my blog. I have all-in-one seo and google xml sitemap. But trying to download extra for the additional help. Will this have a damaging effect on my rankings or will it help tremendously? Thanks very a lot

Leave a Reply