<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Google Adwords Dynamic Keyword Insertion PHP Script</title>
	<link>http://www.davewooding.com/google-adwords-dynamic-keyword-insertion-php-script/</link>
	<description></description>
	<pubDate>Tue, 06 Jan 2009 04:44:12 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.3</generator>
		<item>
		<title>By: admin</title>
		<link>http://www.davewooding.com/google-adwords-dynamic-keyword-insertion-php-script/#comment-297</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Sat, 22 Nov 2008 00:21:47 +0000</pubDate>
		<guid>http://www.davewooding.com/google-adwords-dynamic-keyword-insertion-php-script/#comment-297</guid>
		<description>Hi Susie,

Sorry about not participating in the conversation ... I don't have a good answer for your regarding 301/302.

Dave</description>
		<content:encoded><![CDATA[<p>Hi Susie,</p>
<p>Sorry about not participating in the conversation ... I don't have a good answer for your regarding 301/302.</p>
<p>Dave</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Susie</title>
		<link>http://www.davewooding.com/google-adwords-dynamic-keyword-insertion-php-script/#comment-294</link>
		<dc:creator>Susie</dc:creator>
		<pubDate>Wed, 19 Nov 2008 20:51:58 +0000</pubDate>
		<guid>http://www.davewooding.com/google-adwords-dynamic-keyword-insertion-php-script/#comment-294</guid>
		<description>One last question (I hope).

Is it better to have the redirect be a 301 or a 302, or doesn't it matter as far as Google is concerned?

Thanks, Susie</description>
		<content:encoded><![CDATA[<p>One last question (I hope).</p>
<p>Is it better to have the redirect be a 301 or a 302, or doesn't it matter as far as Google is concerned?</p>
<p>Thanks, Susie</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Susie</title>
		<link>http://www.davewooding.com/google-adwords-dynamic-keyword-insertion-php-script/#comment-293</link>
		<dc:creator>Susie</dc:creator>
		<pubDate>Wed, 19 Nov 2008 20:51:14 +0000</pubDate>
		<guid>http://www.davewooding.com/google-adwords-dynamic-keyword-insertion-php-script/#comment-293</guid>
		<description>Aha, I got my answer. 

Query strings in url redirects are special cases.

So now this is what I have and it works:
RewriteRule ^([^/]+)\.html$ survey.php?q=$1 [QSA,L]

The QSA flag tells it to send through whatever query string it had originally so the end result is that when I put this into the browser:
http://www.mydomain.com/blah.html?RD=123

It redirects to this:
http://www.mydomain.com/survey.php?q=blah&#38;RD=123</description>
		<content:encoded><![CDATA[<p>Aha, I got my answer. </p>
<p>Query strings in url redirects are special cases.</p>
<p>So now this is what I have and it works:<br />
RewriteRule ^([^/]+)\.html$ survey.php?q=$1 [QSA,L]</p>
<p>The QSA flag tells it to send through whatever query string it had originally so the end result is that when I put this into the browser:<br />
<a href="http://www.mydomain.com/blah.html?RD=123" >http://www.mydomain.com/blah.html?RD=123</a></p>
<p>It redirects to this:<br />
<a href="http://www.mydomain.com/survey.php?q=blah&amp;RD=123" >http://www.mydomain.com/survey.php?q=blah&amp;RD=123</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Susie</title>
		<link>http://www.davewooding.com/google-adwords-dynamic-keyword-insertion-php-script/#comment-288</link>
		<dc:creator>Susie</dc:creator>
		<pubDate>Sun, 16 Nov 2008 17:41:07 +0000</pubDate>
		<guid>http://www.davewooding.com/google-adwords-dynamic-keyword-insertion-php-script/#comment-288</guid>
		<description>Hi,

Another question. 

In my case I want the visitor to go to a survey page before continuing to the site. The survey page will use the keyword in its content, but then I want to redirect the user to different pages.

I tried to modify the above so that I can pass the redirect page as a query variable. But being so new with Regex, it isn't working.

Here's what I tried:
RewriteRule ^([^/]+)\.html\?RD=([^&#38;]+)$ survey.php?q=$1&#38;rd=$2 [L] 

Even though I tested the expression with an online tester and it matched and gave me the group values I expected, when I put this into my htaccess and tested it with:
http://www.mydomain.com/blah.html?RD=123

I got a 404 that it couldn't find blah.html. And yes, I did make sure I uploaded the changed htaccess this time :) 

Any advice?

Thanks, Susie</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Another question. </p>
<p>In my case I want the visitor to go to a survey page before continuing to the site. The survey page will use the keyword in its content, but then I want to redirect the user to different pages.</p>
<p>I tried to modify the above so that I can pass the redirect page as a query variable. But being so new with Regex, it isn't working.</p>
<p>Here's what I tried:<br />
RewriteRule ^([^/]+)\.html\?RD=([^&amp;]+)$ survey.php?q=$1&amp;rd=$2 [L] </p>
<p>Even though I tested the expression with an online tester and it matched and gave me the group values I expected, when I put this into my htaccess and tested it with:<br />
<a href="http://www.mydomain.com/blah.html?RD=123" >http://www.mydomain.com/blah.html?RD=123</a></p>
<p>I got a 404 that it couldn't find blah.html. And yes, I did make sure I uploaded the changed htaccess this time :) </p>
<p>Any advice?</p>
<p>Thanks, Susie</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.davewooding.com/google-adwords-dynamic-keyword-insertion-php-script/#comment-287</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Sat, 15 Nov 2008 15:21:10 +0000</pubDate>
		<guid>http://www.davewooding.com/google-adwords-dynamic-keyword-insertion-php-script/#comment-287</guid>
		<description>Hi Susie,

Welcome to my world :)

Dave</description>
		<content:encoded><![CDATA[<p>Hi Susie,</p>
<p>Welcome to my world :)</p>
<p>Dave</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Susie</title>
		<link>http://www.davewooding.com/google-adwords-dynamic-keyword-insertion-php-script/#comment-286</link>
		<dc:creator>Susie</dc:creator>
		<pubDate>Fri, 14 Nov 2008 22:30:53 +0000</pubDate>
		<guid>http://www.davewooding.com/google-adwords-dynamic-keyword-insertion-php-script/#comment-286</guid>
		<description>Ha ha ha!!!

Ignore my previous post. It would help if I actually saved my changed .htaccess before I uploaded it!!</description>
		<content:encoded><![CDATA[<p>Ha ha ha!!!</p>
<p>Ignore my previous post. It would help if I actually saved my changed .htaccess before I uploaded it!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Susie</title>
		<link>http://www.davewooding.com/google-adwords-dynamic-keyword-insertion-php-script/#comment-285</link>
		<dc:creator>Susie</dc:creator>
		<pubDate>Fri, 14 Nov 2008 22:23:45 +0000</pubDate>
		<guid>http://www.davewooding.com/google-adwords-dynamic-keyword-insertion-php-script/#comment-285</guid>
		<description>Hi,

This is a really cool post! Full of possibilities.

For some reason, I couldn't get it to work though. I broke it down into pieces. Before putting a dynamic keyword in my Google ad, I wanted to test the concept.

First I created a page called survey.php in my root directory. Then I added the above code to my .htaccess, changing index.php to survey.php. This is what I put into my .htaccess:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+).html?$ survey.php?q=$1 [L]


Then I pointed my browser to:
http://www.mydomain.com/blah.html

I was expecting to see my survey.php page with ?q=blah

but instead I got a 404:
The requested URL /blah.html was not found on this server.

The error tells me that the code in my .htaccess isn't working. 
Can you shed any light on why it didn't work?

Thanks.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>This is a really cool post! Full of possibilities.</p>
<p>For some reason, I couldn't get it to work though. I broke it down into pieces. Before putting a dynamic keyword in my Google ad, I wanted to test the concept.</p>
<p>First I created a page called survey.php in my root directory. Then I added the above code to my .htaccess, changing index.php to survey.php. This is what I put into my .htaccess:</p>
<p>RewriteEngine On<br />
RewriteBase /<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteRule ^([^/]+).html?$ survey.php?q=$1 [L]</p>
<p>Then I pointed my browser to:<br />
<a href="http://www.mydomain.com/blah.html" >http://www.mydomain.com/blah.html</a></p>
<p>I was expecting to see my survey.php page with ?q=blah</p>
<p>but instead I got a 404:<br />
The requested URL /blah.html was not found on this server.</p>
<p>The error tells me that the code in my .htaccess isn't working.<br />
Can you shed any light on why it didn't work?</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: neil</title>
		<link>http://www.davewooding.com/google-adwords-dynamic-keyword-insertion-php-script/#comment-232</link>
		<dc:creator>neil</dc:creator>
		<pubDate>Fri, 12 Sep 2008 04:27:39 +0000</pubDate>
		<guid>http://www.davewooding.com/google-adwords-dynamic-keyword-insertion-php-script/#comment-232</guid>
		<description>An alternative to using the .htaccess is using a custom 404 error page to do url rewriting.  The premise is simple...

1) your adwords destination url points to a non-existant page on your website.  
2) your custom 404 error page is called, and it deconstructs the keyword from the url
3) the 404 displays the appropiate content or redirects to a page that does the same</description>
		<content:encoded><![CDATA[<p>An alternative to using the .htaccess is using a custom 404 error page to do url rewriting.  The premise is simple...</p>
<p>1) your adwords destination url points to a non-existant page on your website.<br />
2) your custom 404 error page is called, and it deconstructs the keyword from the url<br />
3) the 404 displays the appropiate content or redirects to a page that does the same</p>
]]></content:encoded>
	</item>
</channel>
</rss>
