• I’m trying to set up a second installation of WordPress in a sub-directory:

    https://mydomain.com/lattice-interactive/

    When I try to run the install, I get an error 404 from the main WordPress installation in the root, and the url shows as:

    https://mydomain.com/lattice-interactive/wp-admin/install.php

    The server support said I need to add an .htaccess to the sub-directory, but I tried this and it did not work:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    </IfModule>
                           
    # END WordPress

    This is the content of the .htaccess in the root:

    [redacted a large block of code – i set up a Pastebin for you, please do so in the future]

    Thanks!
    Randy

    • This topic was modified 8 years, 5 months ago by stephencottontail.
    • This topic was modified 8 years, 5 months ago by stephencottontail. Reason: redacted large block of code
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter esilk

    (@esilk)

    I also tried this in the .htaccess of the sub-directory and it also did not work:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    That won’t work because you are rewriting to root, not the sub-directory. Try

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /sub-directory-name/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /sub-directory-name/index.php [L]
    </IfModule>
    # END WordPress

    and obviously change sub-directory-name

    • This reply was modified 8 years, 5 months ago by Mark Ratledge.
    Thread Starter esilk

    (@esilk)

    Thanks Mark, but that did not work either.
    Here is the url:
    https://www.milnerheights.ca/lattice-interactive/

    I tried this in both the htaccess in the root and in the sub-directory and neither worked:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /lattice-interactive/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /lattice-interactive/index.php [L]
    </IfModule>
    # END WordPress

    Could it be something in the existing/root htaccess? I’m really not familiar with this…

    • This reply was modified 8 years, 5 months ago by esilk.

    You don’t use that in both; only in lattice-interactive. Ask your host for help; they may have settings in httpd that don’t allow .htaccess files to override in subdirectories.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Second WordPress Installation in Sub-directory’ is closed to new replies.