I would like the traffic coming to my site from ppc campaigns redirected to a given page say page1.php. The way I want to do is have a string say "ppc" in the destination URL of all my ppc campaign. In other words, my destination URL on all the ppc campaign will have a format like this
http://myurl.com/ppcWhen the visitor arrives at page1.php through a ppc campaign and bookmarks it the bookmark should be
http://myurl.com/page1.php. I can achieve that with "R" flag (force redirect). However, when the visitor tries to revisit the same page by using his bookmark, I want him redirected to a different site say
http://myurl2.com. I am having a problem implementing this part. Here is my code
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/ppc
RewriteRule (.*) /page1.php?id=$1 [L,R]
RewriteRule ^/page1 http://myurl2.com
Problem with the above code is that the visitor gets diverted to myurl2.com even when the ppc string is present in the URL. I was under the impression that "L" flag is supposed to prevent the second RewriteRule from executing when the RewriteCond is satisfied
What am I doing wrong?

The L flag does mean do not read more, but then, whatever you've already done
is sent to the visitor's browser and his browser comes back with a different URL.
In your case, it would come back for page1 and be sent to
http://myurl2.comI am not 100% sure that I understand the effect you want, but you could try adding
another condition which is negated with the !.
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/ppc
RewriteRule (.*) /page1.php?id=$1 [L,R]
RewriteCond %{REQUEST_URI} !^/ppc
RewriteRule ^/page1 http://myurl2.com
But then *everyone* without ppc will go to myurl2.com
If you must only do this ONLY with people that have visited previously
you might need to use cookies, I don't know for sure.
Let's see who else replies.
Bompa