/ Published in: PHP
This needs to be run on an action, or at least I wanted able to get it to run outside of an action, I suggest template_redirect. More information at the link.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// The Base Function wp_redirect('http://www.urlofsite.com/path/to/location',301); // In Use Example add_action('template_redirect', 'redirect'); function redirect(){ if($redirect){ wp_redirect(get_bloginfo('url').'/wp-content/plugins/redirector/site/index.php',302); exit; } }
URL: http://www.fatfolderdesign.com/564/wordpress/redirecting-users-in-wordpress-with-wp_redirect