htaccess query_string redirect only when string equals a specific value


Staff member
I've been searching for hours on how to do this and feel as if I'm close.

I am trying to redirect specific visitors to a different page on my site based on the string parameters passed in the URL.

For exmaple, I want the URL to be redirected to

I am planning on my normal site visitors to access the index.php page without being re-directed, so it should only redirect when the query string matches the value I set.

Here is my code:

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{QUERY_STRING} ^src=msn(.*)$
RewriteRule ^(.*)$ [L]

The above code works when I go to the URL but it does not work for Any idea how I can get it to work when I enter index.php?



I also have the following rules in my .htaccess file:

 ErrorDocument 404 /error404.php

 <IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteBase /blog/
 RewriteRule ^index\.php$ - [L]
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule . /blog/index.php [L]

 RewriteEngine on
 RewriteCond %{HTTP_HOST} ^mywebsite\.com$ [NC]
 RewriteRule ^(.*)$$1 [R=301,L]

The first is a 404 redirect, second is a wordpress file change, and the last forces all pages to be <a href="http://www">http://www</a>.