halben Posted October 21, 2013 Share Posted October 21, 2013 I'm getting the error: Error code: ERR_TOO_MANY_REDIRECTS after writing this filter hook function into my child theme functions.php. My code is below: function redirect_wp_login() { $request = basename($_SERVER['REQUEST_URI']); if ($request == 'wp-login.php') { wp_redirect(site_url('/login')); exit(); } } add_filter('init', 'redirect_wp_login'); Anything wrong with the code? Link to comment https://forums.phpfreaks.com/topic/283162-throwing-redirect-error-instead-of-redirecting-to-page-template-login/ Share on other sites More sharing options...
Ch0cu3r Posted October 21, 2013 Share Posted October 21, 2013 Somewhere else is also redirecting the request multiple times. Your browser is then stopping the request. Link to comment https://forums.phpfreaks.com/topic/283162-throwing-redirect-error-instead-of-redirecting-to-page-template-login/#findComment-1454828 Share on other sites More sharing options...
AbraCadaver Posted October 21, 2013 Share Posted October 21, 2013 I don't know nor like WP, but It looks like, if you are landing on the login page that you get redirected to the login page. Kind of an endless loop. Link to comment https://forums.phpfreaks.com/topic/283162-throwing-redirect-error-instead-of-redirecting-to-page-template-login/#findComment-1454829 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.