Ryan EdmundsGiving WordPress its’ own directory

A lot of WordPress users don’t realize they are able to put WordPress in any folder on their site and still have it use the root domain name for its’ location. This is a basic feature of WordPress that you are able to pull of from the start or after you’ve already installed it. There a few reasons why you might want to do this. It can make things more secure. Moving WP to a location other than your domain’s root is useful if you don’t want people to be able to see your admin area easily. It can also be helpful if you simply want to keep your root folder clear for other things.

If you have installed wordpress in a subdirectory you can make it accessible from the root directory by completing the following steps.

  1. Go to your General Options page. In the box for Blog address (URL) change the address to the root directory’s URL
  2. Click Update Options. (You might get an error message but don’t worry)
  3. Copy the index.php and .htaccess files from the WordPress directory into the root directory of your site.
  4. Open up index.php and find the line that says:
    require('./wp-blog-header.php');
    When you find this, change it to
    require('./wordpress/wp-blog-header.php'); (wordpress being replaced with the name of the directory your WP install is located.

There. Now that was easy, wasn’t it? What if you want to move an already installed version of WordPress into a new directory? This takes a few more steps, but it can still be accomplished without much difficulty.

  • After creating the directory that you want to move WP into, go to your General Options page in wp-admin
  • Change the WordPress URL to the new directory
  • Complete steps 1 and 2 ( ignore errors) and FTP your WordPress files into the new folder
  • Complete steps 3 and 4

There you have it. WordPress should now be safe and sound in the directory of your choice.

Follow this blogger on Twitter!

Ryan Edmunds Written by Ryan Edmunds from CrunchPlay.com
Posted on June 3rd, 2009 and filed under WordPress
Do not forget to subscribe to our RSS feed for updates
  • Digg This Post
  • Tweet This Post
  • Stumble This Post
  • Submit This Post To Delicious
  • Submit This Post To Reddit
  • Submit This Post To Mixx
  • BloggingTips Uses Aweber

5 Responses to “Giving WordPress its’ own directory”

Author comments are in a darker gray color for you to easily identify the posts author in the comments

  1. LGR says:

    I do this occasionally for clients and one of the things I have found is some plugins do not like this. I would recommend testing your favourite plugins before doing this because you never know which ones will start to misbehave.

  2. Ryan says:

    @LGR – Good point, actually. Testing plugins is important in many situations. Its also worthwhile to mention that this could create potential problems with any pages outside WordPress such as a forum or other script.

  3. eris says:

    Very useful. Didn’t know this. Thanks

  4. Well, I am happy to tell you, you were completely correct sir

  5. Mida says:

    Very nice tip i did not about the change you have to make in the index.php, i thought all you have to do is to change the url from wordpress admin setting page

Trackbacks

Comments are closed.

Comments are closed since this post is older than 30 days. However, you can continue this discussion in our popular Blogging Forums

Subscribe To BloggingTips Via RSS Subscribe To Blogging Tips Via Email Follow Us On Twitter Follow us on Facebook Find Out More About Our Newsletter

Sponsors

Blogging Tips Newsletter

Webmaster Corner

 

Our Free E-Books

Site Partners