I have two site sitea.com and siteb.com
I need to redirect pages from sitea.com to siteb.com. The redirect script in sitea.com is
<?php
header("Location: http://siteb.com/somepage");
?>
The redirection is taking without any flaw. The functionality if fulfilled. But I have google analytics tracking on siteb.com which should show that the source is referral from sitea.com
I dug into web developer tools in google chrome and found that siteb.com doesn’t send a referral header in the request.
How do i redirect my visitors from sitea.com to siteb.com which sends the referral headers on siteb.com.?
The best way to keep the referal is to issue a standard 301 from the server.
How to do this using .htaccess
Doing it straight from PHP should also work (as pointed out by DaveRandom) just be sure to include the HTTP response code.
And bellow a table with data from diferent ways to re-direct and it’s impact on analytics.
Original link for the above table.