I am encountering some problems with the wp_redirect and wp_is_mobile functions, on my Wordpress.
I have to pages :
The mobile form page, that is working fine :
<?php
if (!is_mobile())
{
wp_redirect( 'MY URL', 301 ); // Redirect to the non-mobile version of the form
exit;
}
?>
// My html form
The non-mobile form page, that won't redirect : (For securities reasons, I currently removed the redirection script)
<?php
if (wp_is_mobile())
{
wp_redirect( 'MY URL', 301 ); // Redirect to mobile version of the form
exit;
}
?>
// My html form
BUT... the local (WAMP) version of this page is working.
Also, i tried to make a page without any HTML code, where the redirecting does work in both cases :
<?php
if (is_mobile())
{
wp_redirect( 'MY URL', 301 );
exit;
}
else
{
wp_redirect( 'MY URL', 301 );
exit;
}
?>
Thank you for your help.
Well, all I had to do is to recreate the wordpress page. It seems to work fine, now. thanks anyway !