Apr
25
2009
25
2009
Giving WordPress Its Own Directory
Giving WordPress its Own Directory While Leaving Your Blog in the Root Directory
Many people want WordPress to power their site’s root (e.g. http://example.com) but they don’t want all of the WordPress files cluttering up their root directory. WordPress allows you to install the WordPress files to a subdirectory, but have your blog exist in the site root.
The process to move WordPress into its own directory is as follows:
- Create the new location for the core WordPress files to be stored (we will use /wordpress in our examples). (On linux, use mkdir wordpress from your www directory. You’ll probably want to use “chown apache:apache” on the wordpress directory you created.)
- Go to the General panel.
- In the box for WordPress address (URL): change the address to the new location of your main WordPress core files. Example: http://example.com/wordpress
- In the box for Blog address (URL): change the address to the root directory’s URL. Example: http://example.com
- Click Update Options. (Do not worry about the error message and do not try to see your blog at this point! You will probably get a message about file not found.)
- Move your WordPress core files to the new location (WordPress address).
- Copy the index.php and .htaccess files from the WordPress directory into the root directory of your site (Blog address).
- Open your root directory’s index.php file in a text editor
- 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('./wordpress/wp-blog-header.php'); - Login to the new location. It might now be http://example.com/wordpress/wp-admin/
- 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.)
(source: http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory)
Tags: blog
Related Posts
2 Comments + Add Comment
Leave a comment
Categories
- Diary (10)
- IT (19)
- Programming (6)
- Life (6)
- LTT App Store (1)
- Mechatronics (6)
- Others (1)
EverBot.com
EverBot twitter
- Looking forward to seeing Ice Cream Sandwich on my old little Desire. Gonna be in-ter-rest-ting! 2 months ago
- I've learned that everything is uncertain. 4 months ago
- Every morning starts freshly and energetically when I think of YOU <3 4 months ago
- what makes you happy? 4 months ago
- I'm number 4 =) 5 months ago
An article by






Good work! Thank you very much! I always wanted to write in my blog something like that. Can I take part of your post to my blog? Of course, I will add backlink?
@Arianacymn
Sure, go ahead man