Saturday 5 March 2011

Easiest way to hide Wordpress Subdirectory Folder without moving a Single File

Share |
These steps assume you have wordpress already installed in a subdirectory folder.

There seems to be many methods on the web, and sure they work, but we all want the easier way always. Iframes? Really not a good way to go. Htaccess files? Messy.

We want to allow visitors to view your blog directly at http://example.com, not http://example.com/subfolder/

What we can do are these simple steps:
1. Copy your index.php file from your blog's folder to the root directory of your site
2. In the new copied file in your root directory, change the line require('./wp-blog-header.php');  to  require('./subfolder/wp-blog-header.php');
3. Then, log into your wordpress admin panel

Settings -> General
4. Keep the Wordpress address pointing to your subdirectory, but we want to change Site address to just http://example.com
5. Lastly, we load up with our new address at http://example.com and check through just to make sure everything still works just fine. Remember to change all references with hard links in your site.

You are all set. Go figure.

3 comments:

  1. Thanks for the information, very helpful. I was trying to find a way to do what you just explained with my site.

    ReplyDelete
  2. awesome! perfect, just what i was looking for. thanks for having this info available.

    ReplyDelete
  3. PERFECT !!!! Thank you...

    ReplyDelete

Comments will be moderated.
You can always click 'Contact me' link to get in touch directly.