How do i make a 301 redirect?

Following code does a correct 301 redirect

1
2
3
4
5
6
<?php
 header( "HTTP/1.1 301 Moved Permanently" );
 header( "Status: 301 Moved Permanently" );
 header( "Location: http://www.new-url.se/" );
 exit(0);
?>