Serve Discourse from a subfolder, Login redirects to root path

AI-generated summary

A bug report was filed regarding login redirects to the root path when serving Discourse from a subfolder. truman reported that logging in from the homepage on version 3.5.1 redirects users to https://www.example.com instead of the forum subfolder, although logging in from other pages works correctly. The logs indicate a redirect to the root path despite the redirect parameter pointing to the subfolder login page. pmusaraj acknowledged the report. Other users confirmed the issue persists in later versions, including Thiago_Mobilon on 3.6.0.beta3 and Magnetidog on 2025.12.0-latest. zogstrip apologized for the inconvenience and announced a fix in pull request 36609.

version:v3.5.1
my website: https://www.example.com/forum
local login(homepage) will redirect to https://www.example.com

Logging in from a non-homepage does not have this issue.

log

Processing by StaticController#enter as HTML Parameters: {"username"=>"****", "password"=>"[FILTERED]", "redirect"=>"https://www.example.com/forum/login"} Redirected to https://www.example.com/
1 Like

Thanks for the report, we will look into it soonish.

2 Likes

I have the same issue. Version: 3.6.0.beta3

1 Like

We are experiencing the same issue after installing 2025.12.0-latest.

@here sorry about that, I think I managed to reproduce and fix the issue

https://github.com/discourse/discourse/pull/36609

3 Likes

This topic was automatically closed after 16 hours. New replies are no longer allowed.