Location header redirect not working

I have a file in the root of the server:

<?php header("Location: http://www.google.com/", true); //this does not work //echo "Test"; //this is tested and works. ?> 

Is the php.ini file incorrect or why is this possible?

-3
source share
2 answers

remove all spaces before <?php ... and read How to fix a "Headers Already Submitted" error in PHP

+1
source

You forgot the title name:

 header("Location: http://example.com"); 
+6
source

Source: https://habr.com/ru/post/1490109/


All Articles