To Many Redirects
-
I am embarressed bringing this subject up as there are a wealth of articles about it and plugins however I cannot resolve the issue.
I have tried resetting permalinks, deactivating all plugins, removing those that may have any impact on routing, blanked my .htaccess file then built it back bit by bit, installed 3 different plugins and can’t resolve the issue. Yoast comes in for a bit of flack on this and I have removed it entirely. Of course I have played endlessly with the conical settings.
Unlike some my site https://fernleafconsulting.co.uk runs fine. However when I try to create a post or page or user I get the redirect error. When a user tries to register he gets the same.
I have this code running:
// Add page after new user registered add_action('user_register', 'registration_newpage'); function registration_newpage($user_id) { $user_info = get_userdata($user_id); $username = $user_info->user_login; $post = array(); $post['post_name'] = 'Members-Page-for-'.$username; // The name (slug) for the page $post['post_type'] = 'page'; //could be 'page' for example $post['post_content'] = esc_attr($username.' - This page was created for you and any messages that we need to send you with regards to any products, services or changes to your membership will be posted here.'.$userid); $post['post_author'] = $username; $post['post_status'] = 'publish'; //status $post['post_title'] = 'Members Page for '.$username; $postid = wp_insert_post ($post); if (!$post_id) { wp_die('Error creating template page'); } else { update_post_meta($post_id, '_wp_page_template', 'page-members.php'); } return; }
which illustrates what happens. I create a user it gets a redirect error but the user is created. This code fires but fails wp_insert post although the page is created but without the template.
Any help would be greatfully received.
- The topic ‘To Many Redirects’ is closed to new replies.