I can’t make a redirection in wordpress

I try to make a redirection in wordpress to change the page when the website is viewed by a mobile device. (I don’t want wp-touch). The target page is external to wordpress.

I added this code in the header.php wordpress file:

Read More
//test if it is a mobile device
...

if ($mobile_browser > 0) {

    wp_redirect('Location: http://url-to-my-external-page' ); 
    exit;
}

I also tried in the index.php file but it doesn’t work either.

What can I do?

Thanks

Related posts

Leave a Reply

2 comments