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

WordPress非Plain固定链接跳转首页问题求助

Hey there, let’s break down how to diagnose and fix this stubborn permalink issue you’re facing. It’s super common after migrations, so let’s take it step by step—always back up your site and database first (Hostinger has a one-click backup tool, use that before any changes!).

First, Use Tools to Diagnose the Redirects

You mentioned wanting plugins/tools to track down why the redirects are happening—here are two reliable options:

  • Query Monitor: This plugin lets you dig into every request on your site, including exactly what’s triggering the redirect (whether it’s a plugin, theme function, or database rule). Install it, then visit any page that redirects to home; check the "Redirects" tab to see the source.
  • Redirection: Not just for managing redirects, it logs every redirect that happens on your site. After installing, let it run for a few minutes while you test links—you’ll see a log entry for each redirect, showing the original URL, target (home), and what caused it (e.g., "WordPress rewrite rule" or a custom plugin rule).

Check the Low-Hanging Fruit

1. Fix Your .htaccess File

Looking at your current .htaccess, the WordPress rewrite rule section between # BEGIN WordPress and # END WordPress is empty—that’s a big problem! When you set permalinks to anything other than Plain, WordPress needs those core rewrite rules to route URLs correctly.

To fix this:

  • Go to your WordPress admin → Settings → Permalinks
  • Select your desired permalink structure (e.g., Post name)
  • Click Save Changes (even if it’s already selected—this forces WordPress to regenerate and write the correct rules to .htaccess)

Your WordPress section should now look like this (if it doesn’t, double-check that .htaccess has proper write permissions):

# 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

2. Verify Core Database Settings

Since this happened post-migration, let’s confirm your site URLs are correct in the database:

  • Access your Hostinger phpMyAdmin, open your WordPress database
  • Look at the wp_options table (prefix might be different if you changed it)
  • Find the siteurl and home rows—both should be set to your full HTTPS URL (e.g., https://url.com)
  • If they’re not, edit them to the correct value and save

Dig Deeper Into Database Issues

You checked rewrite_rules, but let’s cover a few other migration-related spots:

Reset Rewrite Rules

Sometimes the wp_rewrite_rules table gets corrupted during migration. Try resetting it:

  1. Export the wp_rewrite_rules table from phpMyAdmin as a backup
  2. Empty the table (select all rows, delete them)
  3. Go back to Settings → Permalinks in WordPress and save changes—this will regenerate fresh rewrite rules

Check for Migration Residue

From PrestaShop to WooCommerce migrations, sometimes old URLs or metadata get left behind:

  • In wp_posts, check the guid column—while this doesn’t affect front-end permalinks, if a large number are still pointing to old PrestaShop URLs, it could cause conflicts (you can batch update these with a safe SQL query if needed, but only after backing up)
  • In wp_postmeta, look for _wp_old_slug entries that might be pointing to invalid paths—delete any that seem unrelated to your current site structure

Hostinger/LiteSpeed Specific Checks

Since you’re on Hostinger with LiteSpeed:

  • Clear All Caches: You mentioned clearing cache, but make sure you hit every spot: Hostinger’s site cache, LiteSpeed’s server-level cache, and any CDN cache if you’re using it (Hostinger’s built-in CDN or Cloudflare)
  • Wordfence WAF: Your .htaccess has Wordfence’s WAF rules—try temporarily disabling Wordfence (or commenting out the WAF lines in .htaccess) to rule out it interfering with rewrite rules

Final Notes

If none of these work, try switching to a default WordPress theme (like Twenty Twenty-Four) temporarily—sometimes custom themes have rewrite rule overrides that cause this issue.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.09 16:47:41