Install second wordpress in root subfolder, Error 404

I am trying to install wordpress in a subfolder of an existing wordpress installation. I created a the subfolder /wp unziped a fresh Wordpress download inside of that directory and added a .htaccess with the following content:

RewriteEngine On
RewriteBase /wp/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wp/index.php [L]

However if I visit mysite.com/wp I get an error 404 not found. I already tried the following: Restarting Apache and adding the .htaccess content to the root .htaccess. But it did not help.

Topic directory htaccess installation Wordpress

Category Web


I didn't work with Apache for quite a while, so this is untested. RewriteBase is the base for your rewrite, so it's added to your rule automatically and your .htaccess should look something like this:

RewriteEngine On
RewriteBase /wp/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]

Look here for further explanation: https://stackoverflow.com/questions/704102/how-does-rewritebase-work-in-htaccess

Also, you probably want to only put that in the .htaccess file inside your /wp directory.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.