theDoris Posted January 31, 2016 Share Posted January 31, 2016 (edited) Hi I write my module and I want add redirect to login page: index.php?controller=authenticationI add function with: header("Location: index.php?controller=authentication");and also tried do this with this: Tools::redirect('authentication.php');Every time is error like:This web page has a redirect loop ERR_TOO_MANY_REDIRECTSAny tips? Edited February 1, 2016 by theDoris (see edit history) Link to comment Share on other sites More sharing options...
Knowband Plugins Posted February 1, 2016 Share Posted February 1, 2016 It is saying too many redirect because you are calling redirect function even on login page. Try below code. if((strpos($url,'login')!==false) || (strpos($url,'authentication')!==false)) $page='loginpage'; else $page='otherpage'; if (!$this->context->customer->isLogged() && $page != 'loginpage'){ Tools::redirect('authentication'); } Link to comment Share on other sites More sharing options...
theDoris Posted February 1, 2016 Author Share Posted February 1, 2016 It is saying too many redirect because you are calling redirect function even on login page. Thanks, of course it is because that, this is obvious I do not know what I was thinking... THANKS AGAIN Link to comment Share on other sites More sharing options...
Knowband Plugins Posted February 1, 2016 Share Posted February 1, 2016 Most welcome Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now