PHP error: Cannot modify header information without any html/cookie/space -


i have strange bug script, want redirect user if url finish '/' same url without '/' @ end.

i error:

warning: cannot modify header information - headers sent (output started @ /home/httpd/vhosts/xxx/httpdocs/series.php:1) in /home/httpd/vhosts/xxx/httpdocs/series.php on line 7  warning: cannot modify header information - headers sent (output started @ /home/httpd/vhosts/mxxx/httpdocs/series.php:1) in /home/httpd/vhosts/xxx/httpdocs/series.php on line 8 

code:

<?php $urllast = $_server['request_uri']; $urllast = substr($urllast, -1); if (($urllast == '/') && (!strstr($_server['request_uri'], 'en-streaming'))) {     $newurl = substr($_server['request_uri'],0,-1).'-en-streaming';     header("status: 301 moved permanently", false, 301);     header("location: ".$newurl.""); } 

is there unicode bom before <?php?

when saved file encoding "utf-8 bom(byte order mark)", special character sequence(0xef 0xbb 0xbf) automatically inserted in beginning of file.

just try saving file "utf-8 without bom" (if exists) or try editor.

afaik utf-8 in notepad.exe "with bom".


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -