Viewed   86 times

I am using below code for redirection in wordpress

$currentPage = explode('?', $_SERVER ['REQUEST_URI']);
  $current_page_url = $currentPage[0];
 if($current_page_url == '/e-commerce')
        header("Location :",true);

I am using this code in header.php, i am redirecting to third party that problem?



you need to follow the header call with an 'exit`. However, you might be better using wordpress's inbuilt wp_redirect function:

wp_redirect("Location :");

Using wordpress functions allows plugins to filter the input and sanitises the input (not so applicable here, just good practice).

Friday, August 5, 2022

This should solve your problem. Adapted from an answer found here.

Add the following snippet of code in the functions.php file of your theme:

function admin_default_page() {
  return '/new-dashboard-url';

add_filter('login_redirect', 'admin_default_page');
Saturday, August 13, 2022

My hosted server settings were forcing to and this was causing the problem. I turned this setting off and everything works now, i'd still like to know how to make it work with this setting turned on, though!

Wednesday, September 28, 2022

I include 'pluggable.php' in my plugin and problem fixed

include_once(ABSPATH . 'wp-includes/pluggable.php');
Friday, September 16, 2022

Apparently in iOS 5.1 writing to stdout was disallowed.

Thursday, November 3, 2022
Only authorized users can answer the search term. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :