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

修改WordPress地址(URL)后博客无法显示求助

Troubleshooting WordPress Static Home Page & Missing Pages Issue

Let’s walk through the most common fixes for your problem where only the static home page loads after updating your WordPress and Site URLs to /home and setting "Blogs" as your posts page:

This is the first thing to check because updating your site URLs often breaks WordPress’s rewrite rules, which handle routing to pages and posts.

  • If you can still access your WordPress admin:
    • Go to Settings → Permalinks
    • Select any permalink structure different from your current one (e.g., switch from "Post name" to "Day and name"), save changes
    • Switch back to your preferred structure and save again
  • If you can’t access the admin, use WP-CLI (if available on your staging server):
    • Run this command via SSH: wp rewrite flush
  • Alternatively, manually update your .htaccess file (in your WordPress root directory) with the default WordPress rewrite rules:
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /home/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /home/index.php [L]
    </IfModule>
    # END WordPress
    
    Make sure RewriteBase matches your new site URL path (/home/)

2. Verify WordPress vs. Site URL Alignment

Double-check that your URL settings match where your WordPress files are actually stored:

  • If your WordPress core files are still in the original /resources directory, you should only update the Site URL to /home, leaving the WordPress URL as /resources. The WordPress URL points to where your wp-config.php, wp-content, etc., live, while the Site URL is what visitors see.
  • If you moved the WordPress files to /home, confirm file permissions are correct (directories should be 755, files 644) so the server can access them.

3. Validate Your "Blogs" Posts Page Setup

Ensure the page you selected as your posts page is properly configured:

  • Go to Pages → All Pages and confirm the "Blogs" page exists and isn’t set to draft or private status.
  • Check if the page’s slug (the part after /home/ in its URL) conflicts with any custom post types, categories, or plugins. For example, a category named "blogs" could cause a 404 conflict.

4. Check Staging Server Configuration

Staging environments sometimes have restricted settings—confirm your web server is set up to handle the new URL:

  • For Apache: Ensure the mod_rewrite module is enabled, and your virtual host allows overrides (set AllowOverride All for your site directory).
  • For Nginx: Make sure your server block includes rewrite rules to route all requests to index.php:
    location /home {
        try_files $uri $uri/ /home/index.php?$args;
    }
    
  • Reach out to your hosting provider or dev ops team if you’re unsure about server-level settings.

5. Clear All Caches

Staging environments often hold onto old URL data via caching:

  • Clear your browser cache and test the site in incognito mode.
  • If using a WordPress caching plugin (like WP Rocket or W3 Total Cache), clear its cache from the admin (if accessible) or delete cache files via FTP/SSH.
  • Flush any server-side object caching (e.g., Redis, Memcached) if enabled.

If none of these steps work, try temporarily disabling all plugins to rule out conflicts, or switch to a default theme (like Twenty Twenty-Four) to see if a custom theme is causing the issue.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.27 07:16:57