This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

luizbills
luizbills

When I use Redirect::to('/'); shows an alert in front-end with {'X_OCTOBER_REDIRECT: 'url'}and not redirect. why?

back-end

function onRedirect() {
    return Redirect::to('/');
}

front-end

<a href="#" data-request="onRedirect">Return to homepage</a>

Last updated

Eugene Ternavsky
Eugene Ternavsky

I had the same issue on 404 page. Check response http code returned on ajax request, if it's not success (code 200 or so), October framework won't process redirects.

Last updated

daftspunky
daftspunky

Oh that's interesting, AJAX requests obviously need to force 200 response even on 404 pages.

Asinox
Asinox

I have the same issue, my code returned on ajax request is "success", but there is not redirection... just an object printed in the console like: Object {X_OCTOBER_REDIRECT: "http://www.google.com"}, the only way to redirect was using the data returned in the javascript method, like: window.location.replace(data.X_OCTOBER_REDIRECT);

I dont know if is the right thing, if not, documentation is missing something.

Last updated

tmbenhura15750
tmbenhura15750

I have the same problem. The server is responsing with an empty json array [] instead of returning the redirect JSON directive

info53680
info53680

I have the same problem but only when I change location settings from en

1-6 of 6

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.