Installing Wordpress to a Different Directory then root



If you’re like me, your dislike of clutter goes as far as your Web hosting environment. In other words, the mere thought of all those WordPress files and folders in the root of your domain makes you nauseous. This may not be such an issue for others, although it will be easier to manage your various Web endeavors if you put the WordPress install in its own folder. Say you want to add other Web software installs; you may have a hard time finding the files you need if they’re all mixed in together (although it helps that everything WordPress at this level is named wp-something). It just gets messy if you want to do anything other than just use WordPress.

Installing to a subfolder is the same as installing to the root of a domain, so I won’t go into that. The purpose of this is to have the WordPress install in a subfolder, but have the weblog displaying as if it were in the root folder, and keep the root folder on the server clean. You can either install Word- Press to the subfolder directly, or to the root and then move the files to a subfolder. How you decide to tackle it is up to you; they are both easy to do.

You should really set up permalinks before doing this, since you’ll want them to work regardless. The permalink options are found under Settings → Permalinks. The first thing you should do is create the folder in which you want to put the WordPress install. Then, go to the General Settings page and change the WordPress address URL field to where you want to move your install to, and the Blog address URL field to where you want your site to be. Then click the update button and move all the WordPress files to their new directory except for the index.php and .htaccess files, which should be where you want your site to be. When they are there, open index.php and change this to match where you moved your WordPress install to:

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

That’s a relative link with PHP trying to include wp-weblog-header.php, which is where the WordPress magic starts. Just change the link to point to the file, which should be in your WordPress directory (whatever you’ve chosen to call it), and you’ll be fine. After this, login and update your permalinks structure again to get everything to point to their new destinations.

I think a quick example is in order. Say you have WordPress installed in the root folder (domain. com), and want it to be in a subfolder called wpsystem instead while keeping the actual site in root. That means that when people visit domain.com they’ll see your WordPress site, but when you log in and manage it you’ll do that within the wpsystem folder (or domain.com/wpsystem/ wp-admin/, to be precise).

Now, this means that you’ll need to change the WordPress address URL to domain.com/ wpsystem, because that’s where you want the WordPress install to be, and the weblog address URL to domain.com, because that’s where you want the site to be. Save these settings (don’t worry if anything is acting funky just now), and move all the WordPress files to the domain.com/ wpsystem folder except index.php and .htaccess, which you put in the root of domain.com since that’s where the site is supposed to be. Then, open index.php and locate this code snippet:

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

And replace it with this code snippet:

require(''./wpsystem/wp-weblog-header.php'');

As you can see, the code now points to the wpsystem folder instead, and to the wp-weblog-header.php file. Log in to the WordPress admin interface (which is now on domain.com/wpsystem/ wp-admin/) and update the permalinks, and there you have it.

Legal Disclaimer

Our website is not responsible for the information contained by this article. Webworldarticles.com is a free articles resource thus practically any visitor can submit an article. However if you notice any copyrighted material, please contact us and we will remove the article(s) in discussion right away.


This article was sent to us by: Dora Anderson at 09062010

Related Articles

1. The good and the bad of Blogging
To say that blogging is popular on the Internet is an understatement. In fact, the popularity of blogging stems from the fact that everyone with an Internet connection ca...

2. Writing for a Blog Network to Make Money Online
If you have been thinking about making money online from a blog, but don’t know much about blog installation and optimization; and blog marketing, you may consider ...

3. Do you know the In and Out of Blogging
Ever wonder why most all of the teens today are addicted to the internet? Well it has everything a young exploring mind needs. From browsing the net for document resear...

4. Blogs Are An Essential Part Of Today's Society
They're everywhere on the net. However, have you ever thought about turning a blog into an ebook? Well it can be done, and this article will show you how to do just that. ...

5. How to Make Money With a Blog
In light of the fast rising popularity of the World Wide Web, internet blogging has become quite common. What was once a relatively unknown online service known as bloggi...

6. Why Blog Marketing is so Effective
There are many ways to advertise online. Most of them are very cost effective which makes them very appealing. However the most popular form of advertising now is blog ...

7. Blogging: how to succeed
The word blog is a shortened version of the term "Web log". Essentially, it is a website, which itself is a collection of Web, or internet pages, images, videos or other ...

8. GENERATING TRAFFIC TO YOUR BLOG
Affiliate marketing entails promoting other people or company's product or services through your website or blog for a commission. This means that you need a lot of publici...

9. Military Dedicated Forums
Active military personnel, veterans and ordinary people can now blend and exchange their views through the veterans dedicated forums. These sites...

10. Blog for Women: A healthy approach in women's life
Blog for Women Soroptimist Women are particularly burdened with stress because we tend to take everything on ourselves; children, husban...