You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

WordPress多站点环境下/includes子目录页面404错误求助

Troubleshooting /includes Directory Issues After WordPress Multisite Setup

Hey James, sorry to hear you're stuck with this odd issue—let's walk through the most likely reasons why your /includes subdirectory pages are failing while regular pages work fine post-multisite setup:

1. .htaccess Rewrite Rule Conflicts

WordPress multisite adds a set of rewrite rules that route most requests to index.php for WP to handle. If /includes is a physical directory on your server, these rules might be overriding direct access to its files.

  • First, check if your .htaccess includes conditions to skip existing files and directories. You'll want lines like this before the main multisite rewrite rules:
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    
    These tell the server to prioritize real files/directories over WP's routing. If they're missing, adding them should fix the issue.
  • Double-check that the multisite-specific rules (like those starting with RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin/) aren't accidentally targeting the /includes path.

2. Multisite Configuration Missteps (wp-config.php)

Subdirectory-based multisite can sometimes misinterpret physical directories as potential subsite slugs:

  • Verify SUBDOMAIN_INSTALL is set correctly: If you're using subdirectory multisite, it should be define( 'SUBDOMAIN_INSTALL', false );
  • Make sure PATH_CURRENT_SITE is set to '/' (unless your main site is in a subdirectory) and that you haven't accidentally registered includes as a subsite slug in your network admin.
  • Check for any custom constants related to rewrite rules or site paths that might be interfering with /includes.

3. File Permission Changes

Multisite setup processes sometimes adjust file permissions. Ensure:

  • The /includes directory has permissions set to 755 (readable/executable by the server)
  • Files inside /includes are set to 644 (readable by the server)
  • The server user (e.g., www-data on Apache) owns the directory and files (you can use chown commands if needed).

4. Plugin/Theme Conflicts

Network-activated plugins or your active theme might be adding conflicting rewrite rules:

  • Temporarily deactivate all network-wide plugins and test if /includes pages work. If they do, reactivate plugins one by one to find the culprit.
  • Switch to a default WordPress theme (like Twenty Twenty-Four) to rule out custom theme code causing the issue.

If you can share sanitized snippets of your .htaccess and wp-config.php files (redact database credentials or sensitive keys), we can pinpoint the exact issue faster.

内容的提问来源于stack exchange,提问作者iwillbeawebdeveloper

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 04:27:49