<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Big Webmaster &#187; code</title>
	<atom:link href="http://www.big-webmaster.com/topic/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.big-webmaster.com</link>
	<description></description>
	<lastBuildDate>Fri, 03 Sep 2010 13:51:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Redirect directory and contents using htaccess</title>
		<link>http://www.big-webmaster.com/redirect-directory-contents-htaccess/</link>
		<comments>http://www.big-webmaster.com/redirect-directory-contents-htaccess/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 20:57:22 +0000</pubDate>
		<dc:creator>bigw</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[redirect]]></category>

		<guid isPermaLink="false">http://www.big-webmaster.com/?p=533</guid>
		<description><![CDATA[How to redirect an entire directory and all internal files using the htaccess file. In the example below the site moved from a standard static page website to a site powered by WordPress, and thus moved its images directory as shown below: http://www.example.com/images/ http://www.example.com/wp-content/uploads/ (note: In WordPress, change your media settings by un-checking this box [...]]]></description>
			<content:encoded><![CDATA[<p>How to redirect an entire directory and all internal files using the htaccess file.<br />
<span id="more-533"></span><br />
<img src="http://www.big-webmaster.com/wp-content/uploads/arrow_leftright-150x150.png" alt="" title="arrow_leftright" width="75" height="75" class="alignright size-thumbnail wp-image-179" />In the example below the site moved from a standard static page website to a site powered by WordPress, and thus moved its images directory as shown below:</p>
<p>http://www.example.com/images/<br />

http://www.example.com/wp-content/uploads/</p>

<p>(note: In WordPress, change your <a href="http://codex.wordpress.org/File:options-media.png" target="_blank">media settings</a> by un-checking this box &#8220;Organize my uploads into month- and year-based folders&#8221;. This will keep all your uploads in a single folder.)</p>
<blockquote><p>
RewriteEngine On<br />
RewriteRule ^images/(.*)$ http://www.example.com/wp-content/uploads/$1 [L]
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.big-webmaster.com/redirect-directory-contents-htaccess/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MySQL Query on timestamp using PHP</title>
		<link>http://www.big-webmaster.com/mysql-query-timestamp-php/</link>
		<comments>http://www.big-webmaster.com/mysql-query-timestamp-php/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 21:52:47 +0000</pubDate>
		<dc:creator>bigw</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[timestamp]]></category>

		<guid isPermaLink="false">http://www.big-webmaster.com/?p=433</guid>
		<description><![CDATA[In this example I had to create a query only to display orders for the last 90 days. The orders table is using a standard MySQL timestamp field to store the date of the order. I made timestamp indexed since we will be doing this query against this field. I figured the easiest way was [...]]]></description>
			<content:encoded><![CDATA[<p>In this example I had to create a query only to display orders for the last 90 days.</p>
<p><img class="alignright size-full wp-image-435" title="standard timestamp field in MySQL" src="http://www.big-webmaster.com/wp-content/uploads/timestamp.gif" alt="standard timestamp field in MySQL" width="130" height="42" />The orders table is using a standard MySQL timestamp field to store the date of the order. I made timestamp indexed since we will be doing this query against this field.</p>
<p>I figured the easiest way was to only query those 90 days, that way I didn&#8217;t have to worry about looking at each row and comparing a date during output. All I had to worry about was creating the right query.</p>
<p>The first line simply is the number of days to go back in the query, in this case the number of days is 90.<br />
The next 2 lines are used to create and format our new date 90 days in the past.<br />
In the query we simply select all records that are newer than our 90 day old date.</p>
<blockquote><p>$daysback = 90;<br />
$accessdate = strtotime(&#8220;-$daysback days&#8221;,time());<br />
$mysqldate = date( &#8216;Y-m-d H:i:s&#8217;, $accessdate );</p>
<p>$myquery = &#8220;select id,ordernumber,timestamp from tblorders where (timestamp &gt; &#8216;$mysqldate&#8217;);&#8221;;</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.big-webmaster.com/mysql-query-timestamp-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tracking Email Marketing Results</title>
		<link>http://www.big-webmaster.com/tracking-email-marketing-results/</link>
		<comments>http://www.big-webmaster.com/tracking-email-marketing-results/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 18:49:47 +0000</pubDate>
		<dc:creator>bigw</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[ecommerce]]></category>
		<category><![CDATA[email marketing]]></category>
		<category><![CDATA[results]]></category>
		<category><![CDATA[tracking]]></category>

		<guid isPermaLink="false">http://www.big-webmaster.com/?p=321</guid>
		<description><![CDATA[Find out if users are reading and responding to your email newsletters. This simple method will determine a direct correlation between newsletter clicks and sales. Here is a very simple way to track the clicks the result directly from your email marketing newsletter. Inside your newsletter you are likely going to include links directly to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.big-webmaster.com/wp-content/uploads/successful-email-marketing.jpg"><img src="http://www.big-webmaster.com/wp-content/uploads/successful-email-marketing.jpg" alt="successful email marketing" title="successful email marketing" width="516" height="206" style="border: 1px solid black;" class="aligncenter size-full wp-image-346" /></a></p>
<p>Find out if users are reading and responding to your email newsletters. This simple method will determine a direct correlation between newsletter clicks and sales.</p>
<p><span id="more-321"></span></p>
<p>Here is a very simple way to track the clicks the result directly from your email marketing newsletter.</p>
<p>Inside your newsletter you are likely going to include links directly to the products you are promoting in your online store. In order to track the links coming directly from the newsletter, we will create a special tracking page on your website to intercept, track, and then direct the link to the product.</p>
<p>The links inside your newsletter will look like:</p>
<blockquote><p>http://examplestore.com/track.php?id=1</p></blockquote>
<p>At the end of this link you will notice the <strong>id=1</strong>, the number 1 in this case will stand for a product page.</p>
<p>Now we will use this URL to track the click and then redirect to the product page.<br />
In the code block below we look for the &#8220;id&#8221; variable and then set it inside the script as &#8220;id&#8221;.</p>
<blockquote><p>
<code><br />
<?<br />
$id = 0;<br />
if (isset($_GET['id'])){<br />
$id = $_GET['id'];<br />
}<br />
</code>
</p></blockquote>
<p>Next we write the hit to a simple text file, this will become our log file. In this example we use a file names &#8220;marketinglog.txt.&#8221; Upload a blank file with the file name &#8220;marketinglog.txt&#8221;, and set the permission to be writable on your web server.</p>
<p>We will write the id number, the IP address, and the date to the log file.</p>
<blockquote><p>
<code><br />
//file stuff<br />
$ip = $_SERVER['REMOTE_ADDR'];<br />
$the_date = date("Ymd" ,time());<br />
$myFile = "marketinglog.txt";<br />
$fh = fopen($myFile, 'a') or die("can't open file");<br />
fwrite($fh, $id . "," . $ip . "," . $the_date . "\n");<br />
fclose($fh);<br />
</code>
</p></blockquote>
<p>The next section is where you place your real links. In the example below you can see the ID to URL relationship we are using. </p>
<p>1 = http://examplestore.com/widget-blue.htm<br />
2= http://examplestore.com/widget-red.htm<br />
3= http://examplestore.com/superwidget-deluxe.htm</p>
<p>Note: you can use any identifier you wish here. Maybe instead of an &#8220;id&#8221;, you can use a part number or some other internal numbering system which will make it easier to interpret the data later on.</p>
<p><strong>[If the id is 1]</strong><br />
Case 1:<br />
<strong>[then redirect to the real product page for blue widgets]</strong><br />
header(&#8216;Location:http://examplestore.com/widget-blue.htm&#8217;);<br />
<strong>[since we have a match in the id field, we will "break" which will stop processing]</strong><br />
break;</p>
<p>The last line with &#8220;default&#8221;, means if no id is matched, then redirect to the main page of the website.</p>
<blockquote><p>
<code><br />
switch ($id) {<br />
case 1:<br />
	header('Location:http://examplestore.com/widget-blue.htm');<br />
	break;<br />
case 2:<br />
	header('Location:http://examplestore.com/widget-red.htm');<br />
	break;<br />
case 3:<br />
	header('Location:http://examplestore.com/superwidget-deluxe.htm');<br />
	break;<br />
default:<br />
header('Location: http://examplestore.com');<br />
}<br />
?><br />
</code>
</p></blockquote>
<p><strong>The Full Tracking File</strong></p>
<blockquote><p>
<code><br />
<?<br />
$id = 0;</p>
<p>if (isset($_GET['id'])){<br />
$id = $_GET['id'];<br />
}</p>
<p>//file stuff<br />
$ip = $_SERVER['REMOTE_ADDR'];<br />
$the_date = date("Ymd" ,time());<br />
$myFile = "marketinglog.txt";<br />
$fh = fopen($myFile, 'a') or die("can't open file");<br />
fwrite($fh, $id . "," . $ip . "," . $the_date . "\n");<br />
fclose($fh);</p>
<p>switch ($id) {<br />
case 1:<br />
	header('Location:http://examplestore.com/widget-blue.htm');<br />
	break;<br />
case 2:<br />
	header('Location:http://examplestore.com/widget-red.htm');<br />
	break;<br />
case 3:<br />
	header('Location:http://examplestore.com/superwidget-deluxe.htm');<br />
	break;</p>
<p>default:<br />
header('Location: http://examplestore.com');<br />
}<br />
?><br />
</code>
</p></blockquote>
<p><a href='http://www.big-webmaster.com/wp-content/uploads/viewlog.txt'><strong>Download the php script to view your log file online.</strong></a> (change the extension from txt to php)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.big-webmaster.com/tracking-email-marketing-results/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Website backups</title>
		<link>http://www.big-webmaster.com/website-backups/</link>
		<comments>http://www.big-webmaster.com/website-backups/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 00:51:22 +0000</pubDate>
		<dc:creator>bigw</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[website backup]]></category>

		<guid isPermaLink="false">http://www.big-webmaster.com/?p=284</guid>
		<description><![CDATA[How to automate website backups. Follow this very simple procedure to schedule your website backups. You will be glad you did. Download and install the free software: NCFTP Restart your PC (NCFTP writes a line to the windows path, so this works best upon restart) Open notepad, and create a brand new document, paste in [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.big-webmaster.com/wp-content/uploads/backup-with-ncftp.jpg"><img src="http://www.big-webmaster.com/wp-content/uploads/backup-with-ncftp-150x150.jpg" alt="backup-with-ncftp" title="backup-with-ncftp" width="150" height="150" class="alignright size-thumbnail wp-image-286" /></a>How to automate website backups.</p>
<p>Follow this very simple procedure to schedule your website backups. You will be glad you did.</p>
<p><span id="more-284"></span></p>
<p>Download and install the free software: <a href="http://www.ncftp.com/">NCFTP</a></p>
<p>Restart your PC (NCFTP writes a line to the windows path, so this works best upon restart)</p>
<p>Open notepad, and create a brand new document, paste in the following text and save it as backupwebsite.cmd</p>
<p><code><span style="background-color: yellow;">ncftpget -R -E -u your_ftp_username -p your_ftp_password your_web_ftp_address C:\website backup\  /<br />
</span></code></p>
<p>replace <strong>your_ftp_username</strong> with your FTP login name<br />
replace <strong>your_ftp_password</strong> with your FTP password<br />
replace <strong>your_web_ftp_address</strong> with the FTP address used for your website</p>
<p>You can change the C:\website backup\ to where ever you want to store your backups, just make sure the folder does exist.</p>
<p>The last &#8220;/&#8221; is where the backups will start from, if you FTP right into your web files, then you can leave just the forward slash, but some hosts you have to go into another folder to find your web files, like maybe /public_html or something similar.</p>
<p>Once you have this tested and running, then use the windows task scheduler to make it run when and how often you need.</p>
<p>Be sure and check on the backups every now and then to make sure everything keeps working&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.big-webmaster.com/website-backups/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress image uploader crashing Firefox</title>
		<link>http://www.big-webmaster.com/wordpress-image-uploader-crashing-firefox/</link>
		<comments>http://www.big-webmaster.com/wordpress-image-uploader-crashing-firefox/#comments</comments>
		<pubDate>Sun, 31 May 2009 14:54:00 +0000</pubDate>
		<dc:creator>bigw</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[firefox]]></category>

		<guid isPermaLink="false">http://www.big-webmaster.com/?p=163</guid>
		<description><![CDATA[If you are having trouble with Firefox crashing when you go to try to upload an image using the WordPress flash-based image uploader. Here is a quick fix. Go into your Firefox addons. (Tools &#8211; Add ons). Find the Google Gears entry. Click Disable button, and restart your Firefox Browser.]]></description>
			<content:encoded><![CDATA[<p>If you are having trouble with Firefox crashing when you go to try to upload an image using the WordPress flash-based image uploader. Here is a quick fix.</p>
<p>Go into your Firefox addons. (Tools &#8211; Add ons).</p>
<p>Find the Google Gears entry.</p>
<p>Click Disable button, and restart your Firefox Browser.</p>
<p><a href="http://www.big-webmaster.com/wp-content/uploads/disable-google-gears-firefox.jpg"><img class="alignnone size-full wp-image-164" style="border: 1px solid black;" title="disable google gears firefox" src="http://www.big-webmaster.com/wp-content/uploads/disable-google-gears-firefox.jpg" alt="disable google gears firefox" width="499" height="78" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.big-webmaster.com/wordpress-image-uploader-crashing-firefox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Automatic Update with 1and1</title>
		<link>http://www.big-webmaster.com/wordpress-automatic-update-with-1and1/</link>
		<comments>http://www.big-webmaster.com/wordpress-automatic-update-with-1and1/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 14:37:24 +0000</pubDate>
		<dc:creator>bigw</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[1and1 wordpress]]></category>
		<category><![CDATA[error 500]]></category>

		<guid isPermaLink="false">http://www.big-webmaster.com/?p=96</guid>
		<description><![CDATA[How to make the automatic update work with your WordPress blogs that are hosted on 1and1 shared servers. These are blogs that you set up yourself, not the blog that 1and1 can install for you. The problem I was having was the update would start, and then just stop after a few seconds. Then in [...]]]></description>
			<content:encoded><![CDATA[<p>How to make the <strong>automatic update work with your WordPress blogs that are hosted on 1and1</strong> shared servers. These are blogs that you set up yourself, not the blog that 1and1 can install for you.</p>
<p>The problem I was having was <strong>the update would start, and then just stop</strong> after a few seconds.</p>
<p><img class="alignnone size-full wp-image-98" style="border: 1px solid black;" title="wordpress-update-1and1" src="http://www.big-webmaster.com/wp-content/uploads/2009/02/wordpress-update-1and1.jpg" alt="wordpress-update-1and1" width="447" height="138" /></p>
<p>Then in my wp-content folder I would see a bunch of failed downloads. They were the update zip files with a 0 byte size.</p>
<p>Add the following lines to your .htaccess file in the root directory of your blog.</p>
<blockquote><p><code>AddType x-mapp-php5 .php</code></p></blockquote>
<p>This will enable PHP version 5 + on your blog and then your update should take off.</p>
<p><img class="alignnone size-full wp-image-100" style="border: 1px solid black;" title="working-wordpress-update-1and1" src="http://www.big-webmaster.com/wp-content/uploads/2009/02/working-wordpress-update-1and1.jpg" alt="working-wordpress-update-1and1" width="447" height="266" /></p>
<p>The udpate to PHP 5 <strong>should</strong> also make your blog run a little <span style="color: #008000;"><strong>faster and better</strong></span>.</p>
<p><a href="http://wordpress.org/">Now that WP 3.0.1 is out, it is a good time to test out the automatic upgrade!</a></p>
<p><a href="http://www.1and1.com/?k_id=6460852">Looking to host with 1and1?</a> Affiliate link <img src='http://www.big-webmaster.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.big-webmaster.com/wordpress-automatic-update-with-1and1/feed/</wfw:commentRss>
		<slash:comments>67</slash:comments>
		</item>
		<item>
		<title>Musical Notes</title>
		<link>http://www.big-webmaster.com/musical-notes/</link>
		<comments>http://www.big-webmaster.com/musical-notes/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 17:27:56 +0000</pubDate>
		<dc:creator>bigw</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[music notes]]></category>

		<guid isPermaLink="false">http://www.big-webmaster.com/?p=88</guid>
		<description><![CDATA[How to display musical notes without images. (ASCII) The quarter note: &#9833; which is &#38;#9833; The eighth note: &#9834; which is &#38;#9834; The single bar note: &#9835; which is &#38; #9835; The double bar note: &#9836; which is &#38; #9836;]]></description>
			<content:encoded><![CDATA[<p>How to display musical notes without images. (ASCII)</p>
<p>The quarter note: &#9833; which is &amp;#9833;</p>
<p>The eighth note: &#9834; which is &amp;#9834;</p>
<p>The single bar note: &#9835; which is &amp; #9835;</p>
<p>The double bar note: &#9836;  which is &amp; #9836;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.big-webmaster.com/musical-notes/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Removing the Generator Tag from WordPress</title>
		<link>http://www.big-webmaster.com/removing-the-generator-tag-from-wordpress/</link>
		<comments>http://www.big-webmaster.com/removing-the-generator-tag-from-wordpress/#comments</comments>
		<pubDate>Fri, 14 Nov 2008 15:04:37 +0000</pubDate>
		<dc:creator>bigw</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.big-webmaster.com/?p=67</guid>
		<description><![CDATA[Before making changes to your theme, always make sure you backup your files. Within your themes directory is a file called functions.php. Simply add this line to that file between the php tags (ex: under the &#60;?php tag ) remove_action('wp_head', 'wp_generator'); This will remove the &#8220;generator&#8221; tag from appearing in the meta head section of [...]]]></description>
			<content:encoded><![CDATA[<p>Before making changes to your theme, always make sure you <strong>backup your files</strong>.</p>
<p>Within your themes directory is a file called functions.php. Simply add this line to that file between the php tags (ex: under the <strong>&lt;?php</strong> tag )</p>
<blockquote><p><code>remove_action('wp_head', 'wp_generator');</code></p></blockquote>
<p>This will remove the &#8220;generator&#8221; tag from appearing in the meta head section of your wordpress website.</p>
<p>You will likely also find a generator tag within the theme header file, and it will look something like this:</p>
<blockquote><p>&lt;meta name=&#8221;generator&#8221; content=&#8221;WordPress &lt;?php bloginfo(&#8216;version&#8217;); ?&gt;&#8221; /&gt;&lt;!&#8211; leave this for stats please &#8211;&gt;</p></blockquote>
<p>You can also safely remove these lines also if you&#8217;d like.</p>
<p>Why would I want to do this? Well, there is a small security gain to be made, as some malicious scanners will scan accross the web looking for vulnerable or certain versions of WordPress, and it is in your best interest not to broadcast it out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.big-webmaster.com/removing-the-generator-tag-from-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Secure Contact Form to Prevent Spam</title>
		<link>http://www.big-webmaster.com/secure-contact-form/</link>
		<comments>http://www.big-webmaster.com/secure-contact-form/#comments</comments>
		<pubDate>Tue, 29 Jul 2008 19:16:28 +0000</pubDate>
		<dc:creator>bigw</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[contact]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://www.big-webmaster.com/?p=17</guid>
		<description><![CDATA[If you are looking for a secure and reliable contact form for your website. Please check out www.dagondesign.com/articles/secure-php-form-mailer-script/ The emphases here is on secure, many times these scripts are terribly exploited by spammers, this one seems to be well done. I use this very form on many sites, and it works fabulously. Here is a [...]]]></description>
			<content:encoded><![CDATA[<p>If you are looking for a secure and reliable contact form for your website. Please check out</p>
<p><a href="http://www.dagondesign.com/articles/secure-php-form-mailer-script/">www.dagondesign.com/articles/secure-php-form-mailer-script/</a></p>
<p>The emphases here is on secure, many times these scripts are terribly exploited by spammers, this one seems to be well done. I use this very form on many sites, and it works fabulously.</p>
<p>Here is a sample screen shot of the contact form.</p>
<p><a href="http://www.big-webmaster.com/wp-content/uploads/2008/07/contactform.jpg"><img src="http://www.big-webmaster.com/wp-content/uploads/2008/07/contactform-259x300.jpg" alt="contact form" title="contact form" width="259" height="300" class="aligncenter size-medium wp-image-18" /></a></p>
<p>You can use the &#8220;reCAPTCHA&#8221; tool, or the script has it&#8217;s on method using GD.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.big-webmaster.com/secure-contact-form/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Prevent Hotlinking from Specific Sites Only</title>
		<link>http://www.big-webmaster.com/prevent-hotlinking-from-specific-sites-only/</link>
		<comments>http://www.big-webmaster.com/prevent-hotlinking-from-specific-sites-only/#comments</comments>
		<pubDate>Wed, 02 Jul 2008 16:29:10 +0000</pubDate>
		<dc:creator>bigw</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[hotlink]]></category>
		<category><![CDATA[htaccess]]></category>

		<guid isPermaLink="false">http://www.big-webmaster.com/?p=16</guid>
		<description><![CDATA[You want to prevent hot-linking. But not ALL websites. Sometimes you don&#8217;t mind if someone hotlinks from a forum or a review about your product, etc. However there are those that you DO want to block. You can use the code below and place it into your htaccess file. I placed the code in the [...]]]></description>
			<content:encoded><![CDATA[<p><strong>You want to prevent hot-linking.</strong></p>
<p><img src="http://www.big-webmaster.com/wp-content/uploads/no_entry-150x150.png" alt="no hot link here" title="no_entry" width="150" height="150" class="alignright size-thumbnail wp-image-213" />But not ALL websites. Sometimes you don&#8217;t mind if someone hotlinks from a forum or a review about your product, etc. However there are those that you DO want to block.</p>
<p>You can use the code below and place it into your htaccess file.</p>
<p>I placed the code in the .htaccess file inside my images folder, to just protect that folder, and to keep things straight forward.</p>
<p>If you wish to send a differnt image to the offending website, change the last line to an image that is outside your domain, or in a folder a level above where your .htaccess file is located.</p>
<p>Example: If I placed the code in the .htaccess file inside http://example.com/images, then my &#8220;nohotlink.jpg&#8221; image should be located http://example.com/nohotlink.jpg (otherwise it will blocked by it&#8217;s own rule).</p>
<blockquote><p>RewriteEngine On<br />
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?ebay\.com/ [NC,OR]<br />
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?ebay\.ca/ [NC,OR]<br />
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?abc\.net/ [NC]<br />
RewriteRule .*\.(jpg|gif|bmp|png)$ http://example.com/nohotlink.jpg [L]</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.big-webmaster.com/prevent-hotlinking-from-specific-sites-only/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
