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

404 error - Wordpress multisite on IIS - can't open subpages

programmeradmin0浏览0评论

Our site developer built a new site for us on wpengine. They did a search and replace to fix the URL references before exporting the database and zipping it with the site files to send to us.

I installed and configured everything I know to install (MySQL 5.7.33, URL Rewrite 2.1, PHP 7.4, Wordpress 5.6) and got that all working with a vanilla Wordpress site configured for multisite. I then copied over the new site files, imported the database, and adjusted web.config and wp-config. There is currently only one site in the install. The developer is still building the additional sites for us.

I can get to the home page of the first site, but clicking any links to subpages gives me a 404 Not Found error. I can log in to the admin portal, but it prompts me to re-enter my username and password if I click in to any of the menus. I added the 7 rewrite rules I found in posts on this site. I also tried using IIS's URL Rewrite module to convert the rules from the .htaccess file that came with the new site. I'm a bit out of my element and have exhausted my Google-fu. Does this sound like a rewrite problem or something in the database?

UPDATE: I made some progress. I downloaded a fresh backup of the now live site from wpengine and did a more controlled copy of it into the working, clean Wordpress install on my test server. I only copied wp-content and some files from the root directory that were not present on the test server. This fixed access to wp-admin.

I was then able to tinker with the Permalinks setting. Our developer had it set custom as /%postname%/. If I change it to /index.php/%postname%/ I can get the first level and some second level subpages to work. As I browse deeper though, I eventually get "Sorry, we couldn't fin what you're looking for," or the original 404 error I was getting before.

Am I correct to believe this says it's a problem with the rewrite rules and/or permalinks setting?

发布评论

评论列表(0)

  1. 暂无评论
ok 不同模板 switch ($forum['model']) { /*case '0': include _include(APP_PATH . 'view/htm/read.htm'); break;*/ default: include _include(theme_load('read', $fid)); break; } } break; case '10': // 主题外链 / thread external link http_location(htmlspecialchars_decode(trim($thread['description']))); break; case '11': // 单页 / single page $attachlist = array(); $imagelist = array(); $thread['filelist'] = array(); $threadlist = NULL; $thread['files'] > 0 and list($attachlist, $imagelist, $thread['filelist']) = well_attach_find_by_tid($tid); $data = data_read_cache($tid); empty($data) and message(-1, lang('data_malformation')); $tidlist = $forum['threads'] ? page_find_by_fid($fid, $page, $pagesize) : NULL; if ($tidlist) { $tidarr = arrlist_values($tidlist, 'tid'); $threadlist = well_thread_find($tidarr, $pagesize); // 按之前tidlist排序 $threadlist = array2_sort_key($threadlist, $tidlist, 'tid'); } $allowpost = forum_access_user($fid, $gid, 'allowpost'); $allowupdate = forum_access_mod($fid, $gid, 'allowupdate'); $allowdelete = forum_access_mod($fid, $gid, 'allowdelete'); $access = array('allowpost' => $allowpost, 'allowupdate' => $allowupdate, 'allowdelete' => $allowdelete); $header['title'] = $thread['subject']; $header['mobile_link'] = $thread['url']; $header['keywords'] = $thread['keyword'] ? $thread['keyword'] : $thread['subject']; $header['description'] = $thread['description'] ? $thread['description'] : $thread['brief']; $_SESSION['fid'] = $fid; if ($ajax) { empty($conf['api_on']) and message(0, lang('closed')); $apilist['header'] = $header; $apilist['extra'] = $extra; $apilist['access'] = $access; $apilist['thread'] = well_thread_safe_info($thread); $apilist['thread_data'] = $data; $apilist['forum'] = $forum; $apilist['imagelist'] = $imagelist; $apilist['filelist'] = $thread['filelist']; $apilist['threadlist'] = $threadlist; message(0, $apilist); } else { include _include(theme_load('single_page', $fid)); } break; default: message(-1, lang('data_malformation')); break; } ?>