- Feb 18, 2008
- 1,106
- 455
If you are doing the Google Letters method and get tired of creating 100 "special offer" pages custom for the clients, use this code to make the page custom to the client, but only requires you to create the page ONCE! It took me some days to tweak it to get it to work, but I just got it working.
What will happen is you can tell them to go to www.yoursite.com/offers/whatever and the page will be custom to that "whatever."
I didn't want to use up a root domain page for this so I made this to work in a subfolder. but it can easily be changed to work in the root as well. Here is the code:
1.) In the actual offer page, put this at the top:
and then put:
Or whatever as this will put the variable in the page title as well.
2.) Now in the document where you want it to mention their name or website or whatever, put:
So for example it is
3.) That is half the battle. Now you need to create an .htaccess file. If you aren't sure how, just open up notepad and paste the code below in and save it as "all types" and just name it .htaccess nothing before the "."
This will make anything you put after /offers/ to be defined as the item. I had it include periods that way you can just use their domain names!
4.) Upload this .htaccess and the .php offer page to a subdirectory called "offers".
To see a live example, check out the link below. Know that this is just an example page to show you the capabilities.
http://www.thesecretadvantage.com/offers/BlackHatWorld
or
http://www.thesecretadvantage.com/offers/Black-Hat-World
The best part is you can create spaces (to use names) by using dashes. It looks really legit when you do this.
I hope you find this useful and if you do please thanks or rep!
What will happen is you can tell them to go to www.yoursite.com/offers/whatever and the page will be custom to that "whatever."
I didn't want to use up a root domain page for this so I made this to work in a subfolder. but it can easily be changed to work in the root as well. Here is the code:
1.) In the actual offer page, put this at the top:
PHP:
<?php
$item = $_GET['item'];
if (!$item) $item = "You";
$item2 = str_replace("-", " ", $item);
?>
Code:
<title>Special Offer for <?=$item2;?></title>
2.) Now in the document where you want it to mention their name or website or whatever, put:
Code:
<?=$item2;?>
So for example it is
Code:
An Important Letter and*Exclusive Offer Created Especially for <?=$item2;?>
3.) That is half the battle. Now you need to create an .htaccess file. If you aren't sure how, just open up notepad and paste the code below in and save it as "all types" and just name it .htaccess nothing before the "."
Code:
Options +FollowSymLinks +Indexes
RewriteEngine on
RewriteBase /offers
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^]+)/([^]+)$ index.php?item=$1&query=$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^.]+)$ index.php?item=$1 [L]
# AddHandler application/x-httpd-php .php .htm .html
This will make anything you put after /offers/ to be defined as the item. I had it include periods that way you can just use their domain names!
4.) Upload this .htaccess and the .php offer page to a subdirectory called "offers".
To see a live example, check out the link below. Know that this is just an example page to show you the capabilities.
http://www.thesecretadvantage.com/offers/BlackHatWorld
or
http://www.thesecretadvantage.com/offers/Black-Hat-World
The best part is you can create spaces (to use names) by using dashes. It looks really legit when you do this.
I hope you find this useful and if you do please thanks or rep!
Last edited: