最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

htaccess - Multiple wordpress installations on same server

programmeradmin2浏览0评论

I have three different wordpress sites on my server located like this:

/www -> main site

/www/site2/

/www/site3/

The main site is working but the site2 and site3, which are the wordpress sites inside the folder aren't. I'm getting the following error on site2 and site3, I think it has to do with the htaccess:

Warning: include(modules/.php) [function.include]: failed to open stream: No such file or directory in /www/index.php on line 154

Warning: include() [function.include]: Failed opening 'modules/.php' for inclusion (include_path='.:/usr/share/pear') in /www/index.php on line 154

I have the htaccess on /www/site2/ configured like this:

# 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

Any idea what I'm doing wrong and how should I configure the htaccess?

I have three different wordpress sites on my server located like this:

/www -> main site

/www/site2/

/www/site3/

The main site is working but the site2 and site3, which are the wordpress sites inside the folder aren't. I'm getting the following error on site2 and site3, I think it has to do with the htaccess:

Warning: include(modules/.php) [function.include]: failed to open stream: No such file or directory in /www/index.php on line 154

Warning: include() [function.include]: Failed opening 'modules/.php' for inclusion (include_path='.:/usr/share/pear') in /www/index.php on line 154

I have the htaccess on /www/site2/ configured like this:

# 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

Any idea what I'm doing wrong and how should I configure the htaccess?

Share Improve this question asked Mar 8, 2016 at 15:46 wpuserwpuser 1953 gold badges7 silver badges22 bronze badges 3
  • 1 If these are new sites (or a new setup) I would highly recommend a WP multi-site install. codex.wordpress/Create_A_Network. – jdm2112 Commented Mar 8, 2016 at 16:01
  • Looks like you're rewriting /site2 requests -> /index.php instead of /site2/index.php – Aric Watson Commented Mar 8, 2016 at 16:58
  • Maybe you can easily add sub domain or another domain on your host and put your WordPress files in them. For example your domain would be Domain with default wordpress site and sub1.domain could be another site. – hamed Commented Jan 7, 2017 at 19:11
Add a comment  | 

1 Answer 1

Reset to default 1

Your .htaccess file needs to be updated as follows (change the obvious parts for site3):

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

I was having similar issues and saw that whenever I would log in and simply view the permalink settings, the page would work. I later saw that this action is what corrected the .htaccess file.

@jdm2112, I've managed multiple sites without the need for the multisite. I didn't want to consolidate all my data into a single database.

发布评论

评论列表(0)

  1. 暂无评论