简体   繁体   中英

Wordpress install on root folder and on subfolder

I have to install a new Wordpress on a server, that already contains a Wordpress install on the root directory (/). From now, I installed the new one in a /dev/ subdirectory. myserver.com/dev/ works fine and display the right front page.

But the other pages (like About, Contact, etc.) don't. About (myserver.com/dev/page-about/) just displays the 404 from the root install. Contact page myserver.com/dev/page-contact/ redirects to myserver.com/page-about/.

Here's the .htaccess on /dev/ :

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

# END WordPress

The root install doesn't have a .htaccess... I also checked the permalinks settings, i use permalinks by postname, and it's ok. The db is clean and imported from a local install (i did search and replace on the sql dump to switch to the correct domain). Any ideas ?

try change the .htaccess file

# 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

RewriteBase /dev/ is localhost purpose

It has no concern with the .htacess, try instead editing your menu that created on myserver.com/dev/ has custom URLs which are doing this. Correct the menu and your problem will be resolved.

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