Canonical Redirect Behavior in FlatPress 1.4.1 | Confirmation Request

This is the right place to report general bugs, make suggestions or ask for help.
Post Reply
User avatar
Sean
Posts: 6
Joined: Fri Jul 07, 2023 3:54 am

Canonical Redirect Behavior in FlatPress 1.4.1 | Confirmation Request

Post by Sean » Sat Jan 17, 2026 10:08 am

Hi all —
I’ve been auditing canonical behavior across a clean FlatPress 1.4.1 install and wanted to confirm whether the following redirect logic is expected:
- Requests to /index.php redirect to /
- Requests to /index.php?page=about redirect to /about
- Requests to /index.php?x=y (nonexistent pages) redirect to /

For clarity: this is a fresh 1.4.1 install, and I manually migrated only the content (entries, static pages, images, etc.) from the previous site. No old core files, plugins, or templates were carried over.

This behavior appears consistent across all tested pages. I’ve cleared cache, recompiled templates, and verified results using Screaming Frog and Google’s Live Test — everything looks healthy and indexable.

Is this redirect pattern baked into FlatPress core, or handled via theme/plugin logic?
Just want to confirm it’s intentional before filing any optimization or bug report.

Additional Notes (in case it helps someone else)

1. Static menu block syntax
The static menu block still contained older-style links using index.php?page=...
Updating the menu entries to the clean-URL format (/about, /contact, etc.) fixed mismatched navigation behavior and aligned everything with FlatPress’s preferred routing.

2. Header template cleanup
I added a small metadata block to header.tpl (OG tags, cleaned-up meta structure) while keeping the theme defaults intact.
After clearing cache and recompiled templates, the updated header rendered correctly and canonical tags matched the final URLs.

3. Verification steps
- Fresh FlatPress 1.4.1 install
- Manual content migration only (no old core files or templates)
- Cleared FlatPress cache
- Recompiled Smarty templates
- Full crawl with Screaming Frog
- Google Live Test for canonical and indexability
- Checked for theme or plugin overrides (none found)

After these fixes, the redirect behavior became consistent across the entire site, and all tools confirmed the canonical structure was correct.
This makes me think the redirects are FlatPress core behavior, but I wanted to double-check with the community.
Thanks in advance — happy to share config details or logs if helpful.
Sean Boal • https://seanboal.com

User avatar
fraenkiman
Posts: 470
Joined: Thu Feb 03, 2022 7:25 pm
Location: Berlin, Germany
Contact:

Re: Canonical Redirect Behavior in FlatPress 1.4.1 | Confirmation Request

Post by fraenkiman » Sun Jan 18, 2026 1:02 am

Hello Sean,
Sean wrote: Sat Jan 17, 2026 10:08 am ... the following redirect logic is expected:
- Requests to /index.php redirect to /
- Requests to /index.php?page=about redirect to /about
- Requests to /index.php?x=y (nonexistent pages) redirect to /

For clarity: this is a fresh 1.4.1 install, ...
This redirection is intentional and will likely continue in FlatPress 1.5.
Sean wrote: Sat Jan 17, 2026 10:08 am ...
Is this redirect pattern baked into FlatPress core, or handled via theme/plugin logic?
--.
The Pretty URLs plugin will receive a minor update in FlatPress 1.5. Details can be found in the change log.

Which OG tags have you inserted? Some OG tags are already provided by the SEO Metatags Info plugin.

Best regards,
Frank
:pencil: You are strong in PHP and Java Script? :point_right: Then help us to improve FlatPress. :point_left:

:exploding_head: Looking for ideas, templates, examples and answers to frequently asked questions?
:bulb: You'll find it here.

My :de: FlatPress-Blog: https://frank-web.dedyn.io

User avatar
Sean
Posts: 6
Joined: Fri Jul 07, 2023 3:54 am

Re: Canonical Redirect Behavior in FlatPress 1.4.1 | Confirmation Request

Post by Sean » Mon Jan 19, 2026 7:40 am

Thanks Frank — your clarification on the redirect behavior was helpful. I wanted to follow up with a consolidated summary of what I found while auditing canonical and metadata behavior on a clean FlatPress 1.4.1 install. Posting the full details here in case it helps others.

----------------------------------------

1. Redirect behavior (confirmed intentional)

On a fresh 1.4.1 install, I observed:

• /index.php → /
• /index.php?page=about → /about
• /index.php?x=y (nonexistent pages) → /

This matches what you confirmed — the redirects are intentional and will continue in 1.5. PrettyURLs handles the clean URL routing.

----------------------------------------

2. Canonical tag behavior in Leggero v2 (theme-level detail)

While reviewing metadata output, I noticed that Leggero v2 includes a static canonical line in header.tpl:

Code: Select all

<link rel="canonical" href="{$smarty.const.BLOG_BASEURL}?page={$flatpress.page}">
This works correctly for static pages, but it doesn’t handle entries or PrettyURLs.
On entry pages it outputs non‑canonical paths such as:

• ?x=entry:…
• or mismatched URLs that don’t reflect the final PrettyURL

This led to Search Console warnings such as:

• “Duplicate without user-selected canonical”
• “Google chose different canonical”
• “Page with redirect”

Replacing the static line with the dynamic FlatPress variable resolved the issue:

Code: Select all

{$canonical}
After updating the theme:

• Posts now output the correct PrettyURL with trailing slash
• Static pages output the correct ?page= URL
• Only one canonical tag appears per page
• No redirects or mismatches in the canonical output

Search Console is now reporting clean canonical structure across the site.

----------------------------------------

3. OG tags (plugin-generated, no duplicates)

You asked which OG tags I inserted. For clarity:

• I did not manually add OG tags to the theme
• All OG tags currently on the site are generated by the SEO Metatags Info plugin
• The plugin outputs the full OG block (title, description, image, URL, etc.)
• I only configured a custom OG image path for my site’s emblem

No duplication or conflicts observed.

----------------------------------------

4. File diff for Leggero v2 (canonical fix)

Below is the exact change applied to fp-interface/themes/leggero/leggero-v2/header.tpl.

Original:

Code: Select all

<link rel="canonical" href="{$smarty.const.BLOG_BASEURL}?page={$flatpress.page}">
Updated:

Code: Select all

{$canonical}
This one-line change aligns Leggero v2 with FlatPress core routing and the SEO plugin.

----------------------------------------

5. Summary

For anyone using Leggero v2 with PrettyURLs enabled:

• The theme’s static canonical line works for static pages but not for posts
• Replacing it with {$canonical} ensures correct canonical output everywhere
• This resolves the related Search Console warnings
• OG tags are handled entirely by the SEO Metatags Info plugin

Happy to share more details if helpful.

Best,
Sean
Sean Boal • https://seanboal.com

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest