Title: Installing wordpress in subdirectory
Last modified: August 20, 2016

---

# Installing wordpress in subdirectory

 *  Resolved [dave9966](https://wordpress.org/support/users/dave9966/)
 * (@dave9966)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/installing-wordpress-in-subdirectory/)
 * Hello , I have tried reading and reading and reading about creating and installing
   wordpress as a subdirectory
 * I currently have a html website installed under modgraphic dir
 * I installed wordpress in modgraphic/blog
 * I updated the general settings to match modgraphic/blog for both
 * I have updated the permalinks and htaccess
 * <IfModule mod_rewrite.c>
    RewriteEngine On RewriteBase /blog/ RewriteRule ^index\.
   php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME}!-
   d RewriteRule . /blog/index.php [L] </IfModule>
 * and I updated the index.php file to have
 * require(‘./blog/wp-blog-header.php’);
 * when I visit [http://www.modgraphic.com/blog](http://www.modgraphic.com/blog)
   I see and empty folder,
 * Now there is an empty folder on the server parallel with modgraphic
 * How or what do I have to do so that the url
 * modgraphic/blog points at the proper folder
 * any help is much appreciated! 🙂

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Thread Starter [dave9966](https://wordpress.org/support/users/dave9966/)
 * (@dave9966)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/installing-wordpress-in-subdirectory/#post-3124992)
 * I think I need to have a condition in my root directory htaccess that says
    if
   the url [http://www.modgraphic/blog](http://www.modgraphic/blog) is entered than
   point to the proper folder
 * cause right not a subdirectory that is called mographic is the main site
 *  [Mark Ratledge](https://wordpress.org/support/users/songdogtech/)
 * (@songdogtech)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/installing-wordpress-in-subdirectory/#post-3125003)
 * Put
 * > DirectoryIndex index.php
 * at the top of the .htaccess file in /blog/
 * That tells apache to default to index.php in the /blog/ directory. Probably in
   the .htaccess file in the main web directory, .htaccess defaults to index.html
   and .htaccess files inherit to subfolders.
 *  Thread Starter [dave9966](https://wordpress.org/support/users/dave9966/)
 * (@dave9966)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/installing-wordpress-in-subdirectory/#post-3125008)
 * so my file structure is as follows
 * root/blog
    root/modgraphic
 * and wp is installed in root/modgraphic/blog/
 * which /blog do I add DirectoryIndex index.php ?
 * and [http://www.modgraphic.com/blog](http://www.modgraphic.com/blog) seems to
   be going to
 * root/blog
 *  [wpadvices](https://wordpress.org/support/users/wpadvices/)
 * (@wpadvices)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/installing-wordpress-in-subdirectory/#post-3125039)
 * I think you got confused and followed a lengthy step instead of an easy way. 
   Just create a new directory called ‘blog’ under the modgraphic folder and upload
   the wordpress files to the Blog directory, then install it… That’s simple.
 *  Thread Starter [dave9966](https://wordpress.org/support/users/dave9966/)
 * (@dave9966)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/installing-wordpress-in-subdirectory/#post-3125053)
 * I did this…. but if you visit [http://www.modgraphic.com/blog](http://www.modgraphic.com/blog)
   you will see the parent directory, and I believe its getting confused somehow
 *  Thread Starter [dave9966](https://wordpress.org/support/users/dave9966/)
 * (@dave9966)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/installing-wordpress-in-subdirectory/#post-3125059)
 * Ok so I got it working….. I had to add
    RewriteCond %{HTTP_HOST} ^(www.)?modgraphic.
   com/blog$ RewriteRule ^(/)?$ modgraphic/blog/index.php [L]
 * to the .htaccess in the root directory because as I said before it was going 
   to the dir “blog” which parallel with the modgraphic folder
 * I also then had to remove the “blog” from
 * require(‘./wp-blog-header.php’);
 * Everything is good now!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Installing wordpress in subdirectory’ is closed to new replies.

## Tags

 * [subdirectories](https://wordpress.org/support/topic-tag/subdirectories/)

 * In: [Installing WordPress](https://wordpress.org/support/forum/installation/)
 * 6 replies
 * 3 participants
 * Last reply from: [dave9966](https://wordpress.org/support/users/dave9966/)
 * Last activity: [13 years, 7 months ago](https://wordpress.org/support/topic/installing-wordpress-in-subdirectory/#post-3125059)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
