php header instant redirect if specified campaign urls are visited
<p>I might worrying way too much here, but here it goes...</p>

<p>I have set up google analytic campaign tracking URLs using the <a href="http://support.google.com/analytics/bin/answer.py?hl=en&amp;answer=1033867" rel="nofollow">google campaign link builder</a>.</p>

<p>Which is great, but I have like 20 different tracking urls, and more to come.</p>

<p>These URLs are really ugly and I'm not a fan of the visitor seeing this long tracking url on there first visit to my site.</p>

<p><br /></p>

<p>So this is my idea/theory that I want to put on my <strong>wordpress</strong> site. If anyone would be kind enough to help with the php writing part of it, I would be very grateful. Or any advice if the idea is a bad one.</p>

<p><br /></p>

<p>For example, these are just some of my URL's</p>

<p><a href="http://example.com/?utm_source=Company&amp;utm_medium=MPU&amp;utm_campaign=Promo" rel="nofollow">http://example.com/?utm_source=Company&amp;utm_medium=MPU&amp;utm_campaign=Promo</a></p>

<p><a href="http://example.com/?utm_source=Company&amp;utm_medium=Leaderboard&amp;utm_campaign=Promo" rel="nofollow">http://example.com/?utm_source=Company&amp;utm_medium=Leaderboard&amp;utm_campaign=Promo</a></p>

<p><a href="http://example.com/?utm_source=Company&amp;utm_medium=Take%2BOver&amp;utm_campaign=Promo" rel="nofollow">http://example.com/?utm_source=Company&amp;utm_medium=Take%2BOver&amp;utm_campaign=Promo</a></p>

<p>I would like to instantly redirect all of the above urls too...</p>

<p><a href="http://example.com/" rel="nofollow">http://example.com/</a></p>

<p>Using php in my header.php or functions.php</p>

<p><br /></p>

<p>Is there some how this can be written so I can simply add new tracking urls in an array/case perhaps.</p>

<p>Any suggestions would be great thanks!</p>

<hr />

<p>Please don't laugh as this - but at a guess this is what I'm trying to do...</p>

<pre><code>$landing = $_SERVER['REQUEST_URI'];

$campaigns = array(
"http://example.com/?utm_source=Company&amp;utm_medium=MPU&amp;utm_campaign=Promo",
"http://example.com/?utm_source=Company&amp;utm_medium=Leaderboard&amp;utm_campaign=Promo",
"http://example.com/?utm_source=Company&amp;utm_medium=Take%2BOver&amp;utm_campaign=Promo"
);

if ( $campaigns == $landing ) {

header( 'Location: http://example.com/' ) ;

}
</code></pre>
