1

I have a main wordpress installed on the root and now due to a long story about incompatible plugins I need to install a second full instance of wordpress in a subdirectory.

The main site works fine, as does the site in the subdirectory. As long as I don't activate pretty permalinks on the subsite

Once the subsite has permalinks on only the home page is accessible, any other page is captured by the main install that spits out a 404.

I have the following on my main .htaccess (in the root folder of the site)

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^domain.com
RewriteRule (.*) http://www.domain.com/$1 [R=301,L]
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>


# 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

<Directory /path/to/subdir>
RewriteEngine On
RewriteBase /subdir/
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /subdir/index.php [L]
</Directory>

And this is the content of the .htaccess that resides in the subfolder

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

I thought that either the .htaccess in the subdirectory or the <Directory> directive in the main .htaccess would work. I'm clueless at this point.

0

Most of the time this problem gets solved after flushing the permalinks. By that I mean, one just needs to hit 'Save changes' on 'Permalink settings' page on backend. However you said that you tried pretty permalinks and its not working.

Under "Settings > General", please confirm that you have updated "WordPress Address (URL)" and "Site Address (URL)" to subdirectory.

  • Thanks for the reply!Under "Setting > General" the site url contains the subdirectory. I have also tried to switch back and forth between different permalink settings but the only one that works is the "Default" option with the query string in the URL. – Matteo Cassese Oct 19 '14 at 14:12
  • Please make sure that the .htaccess in sub-directory is writable by WordPress – Prasad Nevase Oct 20 '14 at 15:14
  • I have just checked and it is writable, but wordpress does not change the settings there when I switch from default to pretty permalinks. – Matteo Cassese Oct 21 '14 at 11:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.