Guys. For the first time I come across such nonsense. Here is the code index.php

 <?php header('Location: http://vk.com'); 

Actually all its content. Before the headlines do not display anything. There are no spaces. Does not work = \
Next are cheders too. In general, here is the whole code:

 <?php header('Location: http://vk.com'); header('http 200 OK'); header('content-type: text/html; charset=utf-8'); 

So he directs me to the browser:

http 200 OK content-type: text / html; charset = utf-8

What the...? Maybe someone came across?

  • Feels like it works like print() . Only the " location... " does not display) - Vitaly Kustov
  • Of course, I’ll step on, but still ... the file is closed with "?>"? - Yoharny Babay
  • The closing sign is not required, moreover, they even recommend not to use it. - Alex Kapustin
  • Did php connect themselves or ready-made wamp solutions? I had a problem with him. - Royal

4 answers 4

Most likely, the problem is in php. No other is given. Try reinstalling php - most likely it will help.

  • I had php installed automatically when installing zend server. I do not think that the guys from zend could arrange such a zapadinoku. I will try. you never know. Just what else could it be if not php ... - Vitaly Kustov

Save the file to UTF-8 without a BOM. This will delete the special characters at the beginning of the file that you do not see in the editor.

You can save in notepad ++

  • I do not think that this is the reason. the file with BOM will show an error on the line with Header, indicating that something has already been output. - Dem

Try this:

 <?php header('HTTP/1.1 302 Found'); header('Location: http://vk.com'); ?> 

    copied the code, checked - the code is working, the error is somewhere else