• Resolved dave9966

    (@dave9966)


    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 https://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

    (@dave9966)

    I think I need to have a condition in my root directory htaccess that says
    if the url https://www.modgraphic/blog is entered than point to the proper folder

    cause right not a subdirectory that is called mographic is the main site

    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

    (@dave9966)

    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 https://www.modgraphic.com/blog seems to be going to

    root/blog

    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

    (@dave9966)

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

    Thread Starter dave9966

    (@dave9966)

    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.