To set the front end login redirect to the page from which the user came, we can do the following steps.

Add the below code in the TS template.

#login redirect
[loginUser = ]
page.headerData.200 = COA_INT
page.headerData.200 {
10 = TEXT
10 {
typolink {
parameter = {$loginPid}
additionalParams {
data = getIndpEnv:TYPO3_REQUEST_URL
rawUrlEncode = 1
wrap = &referer=|
}
returnLast = url
}
}
}
[end]

Once this is done, we need to set the “referer” redirect in the flexform of the felogin extension and it should be at top.

 

referrer

That’s it.

Cheers!