<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to customize root path and 404 pages to redirect to application login?]]></title><description><![CDATA[<p dir="auto">We need to handle certain FusionAuth pages as redirects to our application's main login page:</p>
<ul>
<li>Accesses to the root path (e.g., <code>https://login.example.com/</code>)</li>
<li>Invalid URLs (e.g., <code>https://login.example.com/whatever</code>)</li>
<li>Other errors that are unactionable for the user</li>
</ul>
<p dir="auto"><strong>Why:</strong> Some of these pages are unbranded, and users save invalid links to login URLs, then contact support when they see unbranded error pages.</p>
<p dir="auto">Is there a solution within FusionAuth for this use case?</p>
]]></description><link>https://fusionauth.io/community/forum/topic/3270/how-to-customize-root-path-and-404-pages-to-redirect-to-application-login</link><generator>RSS for Node</generator><lastBuildDate>Wed, 21 Oct 2026 00:43:38 GMT</lastBuildDate><atom:link href="https://fusionauth.io/community/forum/topic/3270.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 19 Oct 2026 16:18:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to customize root path and 404 pages to redirect to application login? on Mon, 19 Oct 2026 16:18:48 GMT]]></title><description><![CDATA[<p dir="auto">FusionAuth supports customization for some of these scenarios through themes, but not all:</p>
<h2>1. Root Path Customization</h2>
<p dir="auto"><strong>This is possible.</strong> The Index page can be customized through your FusionAuth theme. You can add a redirect (for example, using JavaScript or a meta refresh tag) to send users to your application's login page.</p>
<p dir="auto"><strong>Important:</strong> When FusionAuth can't identify the tenant (including when browsing to <code>/</code> without <code>client_id</code> or <code>tenantId</code> parameters), it uses the <strong>default tenant</strong>. To theme the root page:</p>
<ol>
<li><strong>Create a copy of the built-in theme</strong> — the default theme is immutable because it ships with FusionAuth</li>
<li><strong>Edit the <code>index</code> template</strong> in your copy to include your redirect (using JavaScript like <code>window.location.href = "https://yourapp.com/login"</code> or HTML meta refresh)</li>
<li><strong>Apply this theme to ALL tenants</strong>, including the default tenant</li>
<li><strong>Test with tenant specified</strong> — try the root URL with <code>tenantId</code> or <code>client_id</code> to confirm your edited theme renders</li>
</ol>
<p dir="auto">See the <a href="https://fusionauth.io/docs/customize/look-and-feel/advanced-themes/#troubleshooting" rel="nofollow ugc">Advanced Themes troubleshooting guide</a> for more details on theme issues.</p>
<p dir="auto">Related: <a href="https://github.com/FusionAuth/fusionauth-issues/issues/378" rel="nofollow ugc">GitHub Issue #378</a></p>
<h2>2. OAuth Error Handling</h2>
<p dir="auto"><strong>This is also possible.</strong> The OAuth error page can be customized in your theme, so you can implement the same redirect approach for customers who saved stale or broken login links. The OAuth error template is available for customization and you can add JavaScript or meta refresh redirects to handle these scenarios.</p>
<p dir="auto">Note that OAuth errors can also be returned as redirect parameters to your application's callback URL (depending on the OAuth flow), which allows your application to handle errors directly rather than showing the FusionAuth-hosted error page.</p>
<h2>3. 404 Pages for Invalid URLs</h2>
<p dir="auto"><strong>This is NOT currently customizable.</strong> The 404 page cannot be customized, including on Cloud deployments. Requests to invalid paths (like <code>/whatever</code>) will show the default error page. This is a known limitation tracked in <a href="https://github.com/FusionAuth/fusionauth-issues/issues/404" rel="nofollow ugc">GitHub Issue #404</a>, which requests additional themed error pages (including 404 and 500 pages).</p>
<h2>Summary</h2>
<p dir="auto">You can handle root path and OAuth error redirects through theme customization by adding JavaScript redirects to the <code>index</code> and OAuth error templates. However, true 404 pages remain uncustomizable. CloudFront configuration is not exposed to customers on cloud deployments, so there's no workaround at that layer.</p>
<h2>Related Documentation</h2>
<ul>
<li><a href="https://fusionauth.io/docs/customize/look-and-feel/advanced-themes/" rel="nofollow ugc">Advanced Themes Documentation</a> - Complete guide to customizing FusionAuth themes</li>
<li><a href="https://fusionauth.io/docs/customize/look-and-feel/advanced-themes/#templates" rel="nofollow ugc">Theme Templates</a> - Full list of available templates including Index and OAuth error</li>
<li><a href="https://fusionauth.io/docs/customize/look-and-feel/advanced-themes/template-variables" rel="nofollow ugc">Theme Template Variables</a> - Variables available in each template</li>
<li><a href="https://fusionauth.io/docs/customize/look-and-feel/advanced-themes/template-variables#index" rel="nofollow ugc">Index Template Variables</a> - Specific to the root page</li>
<li><a href="https://fusionauth.io/docs/customize/look-and-feel/advanced-themes/template-variables#oauth-error" rel="nofollow ugc">OAuth Error Template Variables</a> - Specific to OAuth error page</li>
<li><a href="https://fusionauth.io/docs/apis/oauth/oauth-error" rel="nofollow ugc">OAuth Error API Documentation</a> - How OAuth errors are returned</li>
<li><a href="https://fusionauth.io/docs/get-started/core-concepts/limitations#default-configuration" rel="nofollow ugc">Default Tenant Configuration</a> - Understanding the default tenant</li>
</ul>
]]></description><link>https://fusionauth.io/community/forum/post/8879</link><guid isPermaLink="true">https://fusionauth.io/community/forum/post/8879</guid><dc:creator><![CDATA[FASupportBot]]></dc:creator><pubDate>Mon, 19 Oct 2026 16:18:48 GMT</pubDate></item></channel></rss>