-
Hello,
I’m encountering 404 errors on French translated pages when using TranslatePress with specific settings on my WordPress site. The 404 pages are rendered by WordPress (using my theme’s 404.php template), not Apache. Here’s the setup and issue:
Setup:
Product permalinks Product permalinks – Custom base /product/
Languages: English (default, in subdirectory /en/) and French (/fr/)
Hosting: SiteGround
Plugins: TranslatePress (with “Force language in custom links” and “Add Subdirectory to Default Language” enabled) and Rank Math SEO
Issue:
When I enable Remove Category Base and Remove Parent Slugs in Rank Math to shorten URLs (e.g., from example.com/category/postname to example.com/postname), French translated pages (e.g., example.com/fr/postname) return a WordPress 404 error (with my theme’s design).
Disabling these Rank Math options eliminates the 404 errors, but I want to keep the shortened URLs.
Non-translated pages (e.g., example.com/category/postname) work perfectly with or without these options.
Steps Tried:
Updated .htaccess to ensure language prefixes are handled:
RewriteCond %{REQUEST_URI} ^/([a-zA-Z]{2,3}(-[a-zA-Z]{2})?)/(.*)$ [NC]
RewriteRule ^([a-zA-Z]{2,3}(-[a-zA-Z]{2})?)/(.*)$ index.php?lang=$1&$3 [L,QSA]This had no effect, likely because the 404 is from WordPress, not Apache.
Reset permalinks multiple times.
Cleared SiteGround’s and Cloudflare’s cache after every change.
Checked TranslatePress settings: languages are correctly set, and translations for affected pages exist.
Disabling Rank Math’s Remove Category Base and Remove Parent Slugs resolves the issue, but I lose short URLs.
Request: Could you advise on how to resolve the WordPress 404 errors on French translated pages while keeping Rank Math’s short URL options enabled? Is there a specific TranslatePress setting, filter, or workaround to ensure compatibility with Rank Math’s Remove Category Base and Remove Parent Slugs? Would switching the permalink structure to /%postname%/ resolve the conflict?
Thank you for help!
Best regards,
Olga
The ticket ‘WordPress 404 Errors on French Translated Pages with Rank Math Short URLs’ is closed to new replies.