简体   繁体   中英

.htaccess issues with Wordpress in root directory and separate installation in subdirectory

I have a working installation of Wordpress in top-level directory. I'm trying to place a separate Wordpress installation - a kind of "development environment" with its own code files and database, in a subdirectory.

At the moment, all URL's in the subdirectory have a 404 page not found error.

.htaccess for subdirectory:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /v3
RewriteCond $1 !^(index\.php|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [L]
</IfModule>

.htaccess for main directory:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^laddercapital\.com$ [NC]
RewriteRule ^(.*)$ http://www.laddercapital.com/$1 [R=301,L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/?v3/
RewriteRule . /index.php [L]
</IfModule>

Ideas?

Try setting the RewriteBase in the .htaccess file in the subdirectory. Eg

RewriteBase /v3/wordpress

Please try this for the .htaccess in the subdirectory:

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

Source: WP 404 not found subdirectory

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM