Permanent Redirect with HTTP 301 in php
The htaccess method can be found here.
This is the method that use php to generate the HTTP 301 Redirect.
There are a lot of benefits of using HTTP 301 Redirect. These benefits can be found in the htaccess method post. I need not to repeat it again.
The header(“HTTP/1.1 301″) part must be used before the location part, otherwise PHP will automatically set the status code to HTTP/1.1 302 Found.
The code:
<?php
// Permanent 301 redirection
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://pkill.info/");
exit();
?>
Read more:
- How to redirect old domain to new domain using htaccess redirect
- How to redirect WordPress feed to feedburner using .htaccess
- Speeding up the site by using PHP GZIP compression
- Get the number of all posts in WordPress
- Friendly WordPress navigation using page numbers instead of next and previous links
- Use excerpt in index, category, tag and arhieve pages for WordPress


















Leave your response!