[resolved] Installing wordpress in subdirectory (7 posts)

  1. dave9966
    Posted 3 years ago #

    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]

    and I updated the index.php file to have


    when I visit 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! :)

  2. dave9966
    Posted 3 years ago #

    I think I need to have a condition in my root directory htaccess that says
    if the url 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

  3. 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.

  4. dave9966
    Posted 3 years ago #

    so my file structure is as follows


    and wp is installed in root/modgraphic/blog/

    which /blog do I add DirectoryIndex index.php ?

    and http://www.modgraphic.com/blog seems to be going to


  5. wpadvices
    Posted 3 years ago #

    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.

  6. dave9966
    Posted 3 years ago #

    I did this.... but if you visit http://www.modgraphic.com/blog you will see the parent directory, and I believe its getting confused somehow

  7. dave9966
    Posted 3 years ago #

    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


    Everything is good now!

Topic Closed

This topic has been closed to new replies.

About this Topic