Hi all, Right now everyone who visits the Index page of my website is being redirected to another page using a simple PHP redirect script. Do some people have browsers or security settings that don't allow redirection? Or is there a way I can get around this? I just don't want to lose traffic if people are getting security warnings about redirection, etc. Here's a sample of the code I'm using: <?php $redirects = array( "affiliate" => "http://www.howtobehandsome.com/affiliates/", "" => "http://www.howtobehandsome.com/index7.php" ); $itm = $_GET["itm"]; if (array_key_exists($itm, $redirects)) { $go = $redirects[$itm]; header("Location:$go"); die(); } ?> Code (markup): Thanks in advance!
Hi mcfox, thanks for the reply. The reason I'm using the redirect script is so that I can divert traffic depending on its source. If "Bob" refers a visitor to my site, for example, his link to my site will include the custom value "?itm=bob" after my URL... The PHP script then sees "bob" and diverts the visitor to a landing page titled "bob.html" which is customized with content relevant to Bob's traffic. In other words, the goal is to redirect traffic to different pages depending on where they're coming from. Is there a way to do this using .htaccess? I'm familiar with a simple .htaccess redirect, but I don't know of a way to pass custom values and specify redirects based on those values... Thanks!
Yes, but it's got low PR. My traffic (and my sales in general) are mostly referred by affiliates, so I've never put much effort into SEO. Does Google frown upon the redirects?
.htaccess can be used on the query as well, however you do need good knowledge into rewrite rules. Most browsers accepts redirects, I haven't experienced any problems yet with PHP header redirect.
Good to know, thanks. Unless there's a compelling reason to switch to an .htaccess redirect, I'll stick with the PHP script. (Posted this thread just because I want to be sure I'm not losing a meaningful portion of my traffic because of the redirect.)