If you are a PHP programmer you could have used header() function plenty of times redirecting a page to another page right?

for eg:

But, do you think this is SEO friendly? The answer is Absolutely not!!

There are two different kind of redirection as per the SEO:

1. 302 redirection – which is a temporary redirection.
2. 301 redirection – and this one is a permanent redirection.

If you simply give a header function and the location, it means 302 redirection, which is not good as per the SEO point of view, If you decided to redirect the page permanently then this is wrong.

The correct way of doing is this:

So basically you are telling the header what kind of redirect should happen.

Now how do you check this?

Lets say you have a file called test.php with the above redirection coe, you can check the result in Google Developer tools in Chrome or Firebug in Firefox

See the below screen shot:


Good luck!


Related Posts

Leave a Reply