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

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

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

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

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

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

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.