• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

RESOLVED Warning: Cannot modify header information

kael

New member
Messages
3
Likes
1
Points
1
#1
I'm trying to do a header redirect:

Code:
header("Location: http://www.redirect.to.url.com/");
But I'm getting this error message (no matter what theme I use they all generate the same error message):
Warning: Cannot modify header information – headers already sent by (output started at /wp-content/themes/twentythirteen/header.php:11) in /wp-content/plugins/insert-php/includes/shortcodes/shortcode-php.php(52) : eval()’d code on line 2
 

Temyk

Developer & Support
Messages
1,129
Likes
42
Points
48
#2
Hello.

Do you want to forward a snippet using a shortcode? If so, you will not succeed, since the header function must be called before any output to the browser.
 

kael

New member
Messages
3
Likes
1
Points
1
#3
I want to run a header redirect via a snippet on a specific page - so once a visitor visits the page with the snippet he will be redirected, how can I call it first? how can I use Woody snippets to run a redirect that works?
 

Temyk

Developer & Support
Messages
1,129
Likes
42
Points
48
#4
There's no way to make a redirect with woody's help. You can use other plugins for secure redirects