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

php - Internal Server Errors - Moving working multi-site install to my localhost

programmeradmin4浏览0评论

So I keep bumping into server errors and I can't seem to spot where the issue is stemming from. I am able to log in to my admin panel but the redirects keep creating errors.

Not sure if the issue lies in my .htaccess (which everytime I change seems to just make the matter worse), my .wp-config file or in my database tables (wp_site, wp_options etc)

I have my multi-site install located in WAMP folder at /www/oggo-local/ and am using a sub-directory multi-site setup.

.htaccess

RewriteEngine On
RewriteBase /oggo-local/
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

wp-config

define('WP_DEBUG', false);
define('WP_ALLOW_MULTISITE', true);
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'localhost');
define('PATH_CURRENT_SITE', '/oggo-local/');
define('SITE_ID_CURRENT_SITE', 1);
('BLOG_ID_CURRENT_SITE', 1);

Any help appreciated as I seem to be running in circles. If you need table values from my database I can provide that as well.

So I keep bumping into server errors and I can't seem to spot where the issue is stemming from. I am able to log in to my admin panel but the redirects keep creating errors.

Not sure if the issue lies in my .htaccess (which everytime I change seems to just make the matter worse), my .wp-config file or in my database tables (wp_site, wp_options etc)

I have my multi-site install located in WAMP folder at /www/oggo-local/ and am using a sub-directory multi-site setup.

.htaccess

RewriteEngine On
RewriteBase /oggo-local/
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

wp-config

define('WP_DEBUG', false);
define('WP_ALLOW_MULTISITE', true);
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'localhost');
define('PATH_CURRENT_SITE', '/oggo-local/');
define('SITE_ID_CURRENT_SITE', 1);
('BLOG_ID_CURRENT_SITE', 1);

Any help appreciated as I seem to be running in circles. If you need table values from my database I can provide that as well.

Share Improve this question asked Apr 8, 2020 at 21:45 Bruce BannerBruce Banner 32 bronze badges 2
  • 1 You need to check your server’s error log - that should contain the details of the “Internal Server Error” (500 response). A 500 error is just a generic error that “something” went wrong and normal processing cannot continue. This could be in htaccess, PHP or any place in between. – MrWhite Commented Apr 8, 2020 at 22:03
  • When checking the log after trying to run a Better Search & Replace I get /oggo-local/wp-admin/localhost/oggo-local/wp-admin/tools.php?page=better-search-replace&tab=bsr_search_replace&result=true HTTP/1.1" 404 331 I can access dashboard, log-in etc.... but somewhere the localhost/oggo-local is being thrown again and repeating itself... no idea why or where – Bruce Banner Commented Apr 8, 2020 at 22:28
Add a comment  | 

1 Answer 1

Reset to default 0

For anyone who stumbles across this, the issue lied within my wp_2_options table (the options for my second site within the multi-site).

Whereas for the most part you can forego the http:// before your localhost domain, in this table you cannot. This was causing issues when attempting to upgrade the network etc.

I hope this helps someone - I knew it would be something ridiculous.

发布评论

评论列表(0)

  1. 暂无评论