http://www.mywebsite.com/my-page
on my wordpress page i have a form and i am redirecting my wordpress page to some other website after form submit
i have following code in my functions.php file for submitting form.
add_action('init', 'redirect');
function redirect(){
if(isset($_post['submit']))
{
wp_redirect("www.google.com",301); exit();
}
}
but its not redirecting and showing 404 error and following url on submit http://www.mywebsite.com/my-post/www.google.com
here i am using shortcode to display form on my wordpress page.
what is the reason? any clue?