I have created custom Login module in Joomla 2.5 which appears using fancybox.
Our site is using SEF URL. Now my problem is user is not redirecting to previous page where popup is trigger.
I have used following code in my module and passed it to "return" parameter of login form.
$uri =& JFactory::getURI();
$redirectUrl = urlencode(base64_encode($uri->toString()));
<input type="hidden" name="return" value="<?php echo $redirectUrl; ?>" />
But it redirect with some value appended at the end of URL and shows 404 page.
e.g.
localhost/xxx/xxxx.html
TO
localhost/xxx/xxxx.html7
try this
you can remove the last character?