Home > Back-end >  Install wordpress in another wordpress's subdirectory
Install wordpress in another wordpress's subdirectory

Time:09-28

I have a wordpress site setup at the root directory for example: www.xxxxxxxxxxx.com and now I would like to install another wordpress at one of the subdirectory of it: www.xxxxxxxxxxx.com/folder/

After the installation, I cannot access the wordpress' admin page at the subdirectory, it redirects me to the root wordpress' 404 page "Oops! That page can’t be found."

How can I achieve to have 2 wordpress install and one of them is at the subdirectory of the other?

Many thanks for your help!

CodePudding user response:

To solve this, you need to edit the .htaccess file in your subdirectory WordPress install.

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

CodePudding user response:

Additional information, here is my htaccess:

<Directory "/root_directory/">
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
</Directory>

<Directory "/root_directory/folder/">
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /folder/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /folder/index.php [L]
</IfModule>
</Directory>
  • Related