Re: [PHP] PHP List
- Date: Fri, 29 Apr 2016 20:26:28 -0400
- From: Aziz Saleh <azizsaleh@xxxxxxxxx>
- Subject: Re: [PHP] PHP List
On Fri, Apr 29, 2016 at 8:16 PM, Jennifer <jennifer@xxxxxxxxxxxxxxxxxxxx>
> 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
> Can someone see what the problem might be?
> Thank you,
> $qs = $_SERVER[QUERY_STRING];
> $_REQUEST['seo_redirect'] = $qs;
> $parts = explode('/', $qs);
> $redirect_url = 'https://www.domain.com/'.$parts.'/product/'.$parts;
> header( 'Content-type: text/html; charset=utf-8' );
> header( 'Location: '.$redirect_url );
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
-The included page_hit_counter.php script gets called for both, so that's
not the bottleneck.
1) That isn't the way to decide, try commenting it out and see if there is
actually any difference or not, I call it process of elimination.
2) What reason do you have for using flush/ob_flush?
3) Shouldn't make a difference but you can do the same logic without extra
variables like $qs.
I am also wondering how you execute PHP code (counter script) with the