PHP List
| From: | Jennifer | Date: | Sat, 30 Apr 2016 00:16:46 +0000 |
| Subject: | PHP List | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-325563@lists.php.net to get a copy of this message | ||
I'm wanting to redirect users using a PHP script.
If I use only a .htaccess redirect, it takes approx 1 sec to go to the new URL. However, if I
redirect to the following PHP script first, it takes approx 3 seconds to bring up the new URL. The
included page_hit_counter.php script gets called for both, so that's not the bottleneck.
Can someone see what the problem might be?
Thank you,
Jenni
<?php
$qs = $_SERVER[QUERY_STRING];
$_REQUEST['seo_redirect'] = $qs;
include_once('page_hit_counter.php');
$parts = explode('/', $qs);
$redirect_url = 'https://www.domain.com/'.$parts[1].'/product/'.$parts[2];
header( 'Content-type: text/html; charset=utf-8' );
header( 'Location: '.$redirect_url );
flush();
ob_flush();
exit;
?>