<?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>Lair360 Blog &#187; HTA Script</title>
	<atom:link href="http://lair360.co.uk/blog/category/hta-script/feed/" rel="self" type="application/rss+xml" />
	<link>http://lair360.co.uk/blog</link>
	<description></description>
	<lastBuildDate>Sat, 19 May 2012 09:14:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Vol 3 – .htaccess rewrites &amp; mod – madness!</title>
		<link>http://lair360.co.uk/blog/919/vol-3-%e2%80%93-htaccess-rewrites-mod-%e2%80%93-madness/</link>
		<comments>http://lair360.co.uk/blog/919/vol-3-%e2%80%93-htaccess-rewrites-mod-%e2%80%93-madness/#comments</comments>
		<pubDate>Sat, 25 Sep 2010 18:04:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HTA Script]]></category>
		<category><![CDATA[Vol - Lair360 Episode]]></category>

		<guid isPermaLink="false">http://lair360.co.uk/blog/?p=919</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://lair360.co.uk/blog/919/vol-3-%e2%80%93-htaccess-rewrites-mod-%e2%80%93-madness/' addthis:title='Vol 3 – .htaccess rewrites &#38; mod – madness! ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>Version: 11.2 Revision: 33 Build 21 Vol 3 – .htaccess rewrites &#038; mod – madness! For those who have their own domain and server, have you ever wonder about maintaining your own .htaccess file? It’s very important to keep this file at good health. If you don’t, then you will have a door slammed at [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://lair360.co.uk/blog/919/vol-3-%e2%80%93-htaccess-rewrites-mod-%e2%80%93-madness/' addthis:title='Vol 3 – .htaccess rewrites &amp; mod – madness! ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div><p><strong>Version: 11.2<br />
Revision: 33 Build 21</p>
<p>Vol 3 – .htaccess rewrites &#038; mod – madness!</strong></p>
<p>For those who have their own domain and server, have you ever wonder about maintaining your own .htaccess file? It’s very important to keep this file at good health. If you don’t, then you will have a door slammed at your face with many errors. Even worse, you will get a bunch of spam – hooligans bombarding your pages and scoff all of your resources! In other terms, they will do anything to put your server down and get your domain penalized by famous search engine.</p>
<p>For now, you will be using simple HTA resources. They are also free for distribution.<br />
Therefore, if I were you, I would copy these codes and put a smile on SEO search engine.</p>
<p>1.] Running your very own domain is the biggest gift you can afford. But, wait a second. How do I kick out this *www tags from appearing on the address bar? Well, there is one solution to this dilemma: we use the basic “Host” request and staple “RewriteCond” with your own domain under “RewriteRule” tags. However, this source must be placed above your .htaccess file for it to work.</p>
<p><strong>Method 01 – kick out *www with style!</strong></p>
<pre class="brush: plain; title: ; notranslate">
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^mydomain\.co.uk$ [NC]
RewriteRule ^(.*)$ http://askapache.com/$1 [R=301,L]
</pre>
<p><strong>Method 02 – take a shortcut and don’t bother…</strong></p>
<pre class="brush: plain; title: ; notranslate">
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
</pre>
<p><strong>Method 3 – I want it in a tuxedo!</strong></p>
<pre class="brush: plain; title: ; notranslate">
# Enable Rewrite Engine
RewriteEngine On
RewriteBase /

# Strip the www from your domain
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
</pre>
<p><strong>Method 04 – I want it in a simpler form!</strong></p>
<pre class="brush: plain; title: ; notranslate">
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</pre>
<p>2.] For those who love SSL encryption, you can use these sources for your server. However, you got to be careful! These methods will only work, if you have a dedicated IP address. If you don’t have one by default, then get your skull on the chat-line and make a request with your hosting provider!</p>
<p>If you want to redirect “non-https” to a real “https” directory, then why not use these samples? They are short, simple and it doesn’t eat a lot of space on your .htaccess file.</p>
<p><strong>Method 01 – Use “https” without “mod_ssl”.</strong></p>
<pre class="brush: plain; title: ; notranslate">
RewriteCond %{HTTPS} !=on
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
</pre>
<p><strong>Notes:</strong> if you want to direct your domain from a specific PORT, then, get this version.<br />
Now, here is a lolly for you to chew. Its htaccess candies after all…</p>
<pre class="brush: plain; title: ; notranslate">
RewriteCond %{SERVER_PORT} !^443$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
</pre>
<p><strong>Method 02 – I want precision!</strong></p>
<pre class="brush: plain; title: ; notranslate">
RewriteEngine On
RewriteCond %{HTTPS} !=on [OR]
RewriteCond %{HTTP_HOST} != example.com
RewriteRule ^ https://example.com%{REQUEST_URI} [L,R=301]
</pre>
<p><strong>Method 03 – Search Engine Friendly.</strong></p>
<pre class="brush: plain; title: ; notranslate">
Options Options +FollowSymlinks
RewriteEngine On
RewriteCond %{SERVER_PORT} !=443
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
</pre>
<p>3.] In this section, you should add these sources into your .htaccess file. It will cloak all of your directories on your server that doesn’t have an index page. You will also be surprise that it hold tiny amounts of coding and resources. So, if I were you, I would slap this pretty script into your .htaccess file for better security and protection against directory spies and evil bots.</p>
<p><strong>Method 01 – Disable Indexies Only!</strong></p>
<pre class="brush: plain; title: ; notranslate">
Options –Indexes
</pre>
<p><strong>Notes:</strong> if you want to hide everything and prevent directory listing, then,  you better staple this after “Options –Indexes”. However, got to be careful and lists the files that you want to hide / cloak from prying eyes.</p>
<pre class="brush: plain; title: ; notranslate">
Options –Indexes
IndexIgnore *
</pre>
<p><strong>Notes:</strong> the above will hide everything – including your images! Therefore, I’ve made another sample for you to use. You may use this source instead of the above. But, you must type / input your own extension.</p>
<pre class="brush: plain; title: ; notranslate">
Options –Indexes
IndexIgnore *.gif *.jpg *.png

IndexIgnore readme.txt .htaccess
</pre>
<p>See the above rules? You can also give out file names! Pretty simple and stylish!!</p>
<p>4.] If you are bored to death with the old name, then, change it for your own good! We don’t want you to fall asleep, normally looking at your .htaccess file!</p>
<pre class="brush: plain; title: ; notranslate">
# Rename your htaccess files
AccessFileName file.hta
</pre>
<p>5.] Have you wonder where do these spammer came from? Well, the truth behind this is internet –bots gathering email addresses, server addresses and many other thing, such as hacking. But, don’t just hold your breath! There is more! So, be careful and keep a lookout for these hooligans. We don’t want them and so do you!</p>
<pre class="brush: plain; title: ; notranslate">
Order allow,deny
deny from .domain1.org
deny from domain2.org
allow from all
</pre>
<p>You can use this as well for domain blocking. But, don’t be stupid and block your own domain. If you do this by mistake or just for stupid fun. Well, all I can say is be prepare for some nasty surprise! Good luck with that!!</p>
<pre class="brush: plain; title: ; notranslate">
RewriteCond %{HTTP_REFERER} ^https?://([^.]+\.)*example\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^https?://([^.]+\.)*example\.com [NC]
RewriteRule ^ - [F]
</pre>
<p>If you want to be smart and shorten your time with image linkers, then slap this into your .htaccess file. This script will boot any person / user from eating MOST of your bandwidth. Just save the rest for the angel will ya?</p>
<p><strong>Warning:</strong> image thief shall be booted! Beware of dogs!!</p>
<pre class="brush: plain; title: ; notranslate">
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ - [F]
</pre>
<p>6.] Email bots will… let just say: most of them will harvest your email addresses or eat your bandwidth until you are dry. They also act like idiots and they will love your medicine, if you add these sources for protection. </p>
<p>- I love you .htaccess! You are my hero!!</p>
<p>Ohhh… just forget the romance and stick this in your .htaccess file!</p>
<pre class="brush: plain; title: ; notranslate">
RewriteCond %{HTTP_USER_AGENT} ^Wget [OR]
RewriteCond %{HTTP_USER_AGENT} ^CherryPickerSE [OR]
RewriteCond %{HTTP_USER_AGENT} ^CherryPickerElite [OR]
RewriteCond %{HTTP_USER_AGENT} ^EmailCollector [OR]
RewriteCond %{HTTP_USER_AGENT} ^EmailSiphon [OR]
RewriteCond %{HTTP_USER_AGENT} ^EmailWolf [OR]
RewriteCond %{HTTP_USER_AGENT} ^FrontPage [OR]
RewriteCond %{HTTP_USER_AGENT} ^vayala [OR]
RewriteCond %{HTTP_USER_AGENT} ^Image\ Stripper [OR]
RewriteCond %{HTTP_USER_AGENT} ^Image\ Sucker [OR]
RewriteCond %{HTTP_USER_AGENT} ^ExtractorPro
RewriteRule ^.* - [F,L]
</pre>
<p>Alright everyone! This is the end Lair360’s Volume 3. But, don’t forget to support this domain and do some donation. If you don’t, then I will have to stop everything and pull the plug. Simple as it can be. No more FREE articles and resources to share or learn…</p>
<p><strong>Copyrighted By Lair360</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://lair360.co.uk/blog/919/vol-3-%e2%80%93-htaccess-rewrites-mod-%e2%80%93-madness/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Give the thieves a good kick in the butt!</title>
		<link>http://lair360.co.uk/blog/871/give-the-thieves-a-good-kick-in-the-butt/</link>
		<comments>http://lair360.co.uk/blog/871/give-the-thieves-a-good-kick-in-the-butt/#comments</comments>
		<pubDate>Sat, 27 Mar 2010 16:48:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HTA Script]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[htaccess rules]]></category>
		<category><![CDATA[image blocking]]></category>

		<guid isPermaLink="false">http://lair360.co.uk/blog/?p=871</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://lair360.co.uk/blog/871/give-the-thieves-a-good-kick-in-the-butt/' addthis:title='Give the thieves a good kick in the butt! ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>Version: 11.1 Revision: 33 Build 12 Give the thieves a good kick in the butt! For the passed months, I was reading a book about “Linux coding”. It really made me wanting to simplify the ‘htaccess’ by modifying parts of my blocking sequences. So that the server doesn’t get angry and overkill the resources. However, [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://lair360.co.uk/blog/871/give-the-thieves-a-good-kick-in-the-butt/' addthis:title='Give the thieves a good kick in the butt! ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div><p><strong>Version: 11.1<br />
Revision: 33 Build 12<br />
<br />
Give the thieves a good kick in the butt!<br />
</strong><br />
For the passed months, I was reading a book about “Linux coding”. It really made me wanting to simplify the ‘htaccess’ by modifying parts of my blocking sequences. So that the server doesn’t get angry and overkill the resources. However, this source will only support ‘Linux’ servers with HTA backbone support.<br />
<br />
1.] Create a new ‘HTA script file’ and copy these codes…</p>
<pre class="brush: plain; title: ; notranslate">
RewriteCond %(HTTP_REFERER) !^http(s)?://(www\.)?your-domain\.com [NC]
RewriteCond %(HTTP_REFERER) !^$
RewriteCond %(HTTP_REFERER) ^http(s)?://.*$
RewriteRule \.(jpe?g|gif|png|bmp)$ - [F]
</pre>
<p>2.] Save your new ‘HTA file’ and delete your old revision. Nevertheless, if you want to keep your old file, you will need to rename it as ‘old.htaccess’ or something like that.<br />
<br />
3.] Upload your new ‘htaccess’ file and delete your internet temporary files.<br />
<br />
4.] You are done!<br />
<br />
<strong>Tips for confused users</strong><br />
<br />
&#8216;nocase | NC&#8217; [no case] – this source makes the test case-insensitive. In other terms, there is no similarity or difference between ‘upper-cases and lower-cases’. This flag is effective only for comparison, and it has no direct – effect on file systems and sub-request checks.<br />
<br />
&#8216;ornext | OR&#8217; [or next condition] – this source is useful if you want to link or combine individual rules with a local OR instead of the using AND.<br />
<br />
&#8216;forbidden | F&#8217; (force URL to be forbidden) – this source forces the Url to be forbidden for all users. So, if you ever add one of these commands, there is going to be a 403 (FORBIDDEN) message right at your door.<br />
<br />
‘^’ – this is the start of line anchoring.<br />
‘$’ – this is the end of line anchoring<br />
<br />
<strong>Copyrighted By Lair360</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://lair360.co.uk/blog/871/give-the-thieves-a-good-kick-in-the-butt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTA Script &#8211; Parse HTML files as PHP</title>
		<link>http://lair360.co.uk/blog/731/hta-script-parse-html-files-as-php/</link>
		<comments>http://lair360.co.uk/blog/731/hta-script-parse-html-files-as-php/#comments</comments>
		<pubDate>Sat, 07 Nov 2009 11:25:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HTA Script]]></category>
		<category><![CDATA[PHP & HTML Script]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[php parse]]></category>

		<guid isPermaLink="false">http://lair360.co.uk/blog/?p=731</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://lair360.co.uk/blog/731/hta-script-parse-html-files-as-php/' addthis:title='HTA Script &#8211; Parse HTML files as PHP ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>Version: 13.1 Revision: 23 Build 13 Parse HTML files as PHP Introduction: On the 29th of October, I was trying to get my server to parse php codes from a html / htm file. However, when I tried to define the extension, my server just prompt the user to download a file. But, that is [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://lair360.co.uk/blog/731/hta-script-parse-html-files-as-php/' addthis:title='HTA Script &#8211; Parse HTML files as PHP ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div><p><strong>Version: 13.1<br />
Revision: 23 Build 13<br />
<br />
Parse HTML files as PHP<br />
<br />
<img src="http://lair360.co.uk/blog/wp-content/uploads/2009/11/pickaweb-server-logo.jpg" alt="pickaweb-server-logo" title="pickaweb-server-logo" width="249" height="113" class="alignleft size-full wp-image-732" />Introduction:</strong> On the 29th of October, I was trying to get my server to parse php codes from a html / htm file. However, when I tried to define the extension, my server just prompt the user to download a file. But, that is not what I wanted! So, I asked Pickaweb for assistance. Soon enough, my problem was fixed!<br />
<br />
Here is my tutorial for Pickaweb users. But, please be aware that this article is only for user who is registered with Pickaweb, as their hosting provider.<br />
<br />
<strong>Notes:</strong> by parsing php codes inside your html file, you can implement image &#8211; ads and other sources without touching your main file. This is also useful if you’re adding a big chunk of codes without messing your original html / htm files.<br />
<br />
1.] Login to your FTP server and look for your “.htaccess” file.<br />
<br />
2.] Rename the file and download it to your hard drive.<br />
<br />
3.] Copy one of these codes and paste it to the bottom of your “.htaccess” file.</p>
<pre class="brush: php; title: ; notranslate">
// For PHP5 Server.
// -----------------------
AddHandler application/x-httpd-php5 .html .htm
AddType x-mapp-php5 .html .htm

// For PHP4 Server.
// ----------------------
AddHandler application/x-httpd-php4 .html .htm
AddType x-mapp-php4 .html .htm
</pre>
<p>4.] Save your changes and delete your old “.htaccess” file (online server).<br />
<br />
5.] Upload your modified file and rename it. After that, you will need to clear your Internet caches and temporary files.<br />
<br />
6.] Check your website and have fun!<br />
 <br />
7.] You are done!<br />
<br />
<strong>Copyrighted By Lair360</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://lair360.co.uk/blog/731/hta-script-parse-html-files-as-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTA &#8211; Redirect everyone for site maintenance</title>
		<link>http://lair360.co.uk/blog/681/hta-redirect-everyone-for-site-maintenance/</link>
		<comments>http://lair360.co.uk/blog/681/hta-redirect-everyone-for-site-maintenance/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 14:46:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HTA Script]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[domain transfer]]></category>
		<category><![CDATA[how to transfer domain]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[url redirection]]></category>

		<guid isPermaLink="false">http://lair360.co.uk/blog/?p=681</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://lair360.co.uk/blog/681/hta-redirect-everyone-for-site-maintenance/' addthis:title='HTA &#8211; Redirect everyone for site maintenance ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>Version: 13.2 Revision: 34 Build 13 HTA &#8211; Redirect everyone for site maintenance. Introduction: When I checked my email, I had a request from a uni-student. He&#8217;s asked me for help. It&#8217;s about blocking users from his old domain and redirecting them to his new domain. Notes: this is also useful if you want to [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://lair360.co.uk/blog/681/hta-redirect-everyone-for-site-maintenance/' addthis:title='HTA &#8211; Redirect everyone for site maintenance ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div><p><strong>Version: 13.2<br />
Revision: 34 Build 13<br />
<br />
HTA &#8211; Redirect everyone for site maintenance.<br />
<br />
Introduction:</strong> When I checked my email, I had a request from a uni-student.<br />
He&#8217;s asked me for help. It&#8217;s about blocking users from his old domain and redirecting them to his new domain.<br />
<br />
<strong>Notes:</strong> this is also useful if you want to tell &#8220;Google Engine&#8221; that you are changing domain name.<br />
<br />
Anyway, if anybody wants to use this script, then you must have &#8220;Static IP Address + HTA Engine.&#8221; However, if you haven&#8217;t got HTA engine, then you&#8217;ll need to consult this problem with your provider.<br />
<br />
<strong>Warning:</strong> if you want to check your old domain, you must input the correct IP address (your IP Address), or else, you be redirected to your new domain. Also, if you want to keep this script, then you&#8217;ll need to comment out &#8220;Remote Address&#8221;. Just add &#8216;#&#8217; before each command. But, there is another thing: this will only work if you still have your previous domain name. </p>
<p>Finally, if you have SSL encryption, please use this command: &#8220;https&#8221; &#8211; encrypted connection.<br />
<br />
<strong>Caution *1:</strong> if there is a problem with the script, just keep it simple and remove &#8220;R=301&#8243; and replace it with &#8220;R&#8221;.<br />
<strong>Caution *2:</strong> if your website has SSL, then please comment &#8220;HTTP_HOST&#8221; and remove comments for this command: &#8220;SERVER_PORT&#8221;.<br />
<br />
<strong>HTA &#8211; Redirect everyone to a new domain (accept you).<br />
———— Copy Text —————</strong></p>
<pre class="brush: vb; title: ; notranslate">
RewriteEngine On
Options +FollowSymLinks
# This is where you add your IP address.
RewriteCond %{REMOTE_ADDR} !^1\.2\.3\.4$
#---------------------
# This is use if your hosting provider requires ports.
# RewriteCond %{SERVER_PORT} 80 [NC,OR]
# RewriteCond %{SERVER_PORT} 443 [NC]
# RewriteCond %{REQUEST_URI} example
#---------------------
# Match a specific domain OR sub domain (if it exist).
RewriteCond %{HTTP_HOST} ^(.+\.)?example\.co\.uk$ [NC,OR]
RewriteCond %{HTTP_HOST} ^(.+\.)?example\.co\.cc$ [NC]
# %1 is the sub domain (or empty).
RewriteRule ^(.*)$ http://%1example.net/$1 [R=301,L]
# RewriteRule ^(.*)$ https://%1example.net/$1 [R=301,L]
</pre>
<p><strong>———— End —————</strong><br />
<br />
<strong>Notes:</strong> if you don&#8217;t have SSL and the above looks complicated, please use this instead.<br />
<strong>———— Copy Text —————</strong></p>
<pre class="brush: vb; title: ; notranslate">
RewriteEngine On
Options +FollowSymLinks
# This is where you add your IP address.
RewriteCond %{REMOTE_ADDR} !^1\.2\.3\.4$
# Match a specific domain OR sub domain (if it exist).
RewriteCond %{HTTP_HOST} ^(.+\.)?example\.co\.uk$ [NC,OR]
RewriteCond %{HTTP_HOST} ^(.+\.)?example\.co\.cc$ [NC]
# %1 is the sub domain (or empty).
# %2 is SSL encryption (or disabled)
RewriteRule ^(.*)$ http://%1example.net/$1 [R=301,L]
</pre>
<p><strong>———— End —————<br />
<br />
Copyrighted By Lair360</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://lair360.co.uk/blog/681/hta-redirect-everyone-for-site-maintenance/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>HTA &#8211; CEO friendly redirects</title>
		<link>http://lair360.co.uk/blog/678/hta-ceo-friendly-redirects/</link>
		<comments>http://lair360.co.uk/blog/678/hta-ceo-friendly-redirects/#comments</comments>
		<pubDate>Sun, 18 Oct 2009 18:26:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HTA Script]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[apache rewrite]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[seo search engine]]></category>
		<category><![CDATA[url rewrite]]></category>

		<guid isPermaLink="false">http://lair360.co.uk/blog/?p=678</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://lair360.co.uk/blog/678/hta-ceo-friendly-redirects/' addthis:title='HTA &#8211; CEO friendly redirects ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>Version: 11.1 Revision: 23 Build 13 HTA &#8211; CEO friendly redirects. Introduction: when I was eating at the Fish &#8216;n Chips shop, my head was thinking about links redirect (www and non &#8211; www). But, its not just about this redirect! It&#8217;s about your site&#8217;s CEO. In other terms, I have to create a smaller [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://lair360.co.uk/blog/678/hta-ceo-friendly-redirects/' addthis:title='HTA &#8211; CEO friendly redirects ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div><p><strong>Version: 11.1<br />
Revision: 23 Build 13<br />
<br />
HTA &#8211; CEO friendly redirects.<br />
<br />
Introduction:</strong> when I was eating at the Fish &#8216;n Chips shop, my head was thinking about links redirect (www and non &#8211; www). But, its not just about this redirect! It&#8217;s about your site&#8217;s CEO. In other terms, I have to create a smaller HTA file which consists these redirect without hurting other search engines. But, don&#8217;t panic, these codes were written from scratch and tested for a month!<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
<br />
1.] Download Notepad++ (http://notepad-plus.sourceforge.net/) from the author’s website and install the application.<br />
<br />
2.] Paste these codes and save it as: &#8220;codes.htaccess&#8221; file. After that, just delete your old HTA file (which is located in your server) and upload your new version. Then, you&#8217;ll need to rename it as: &#8220;.htaccess&#8221; (without the &#8216;codes&#8217;).<br />
<br />
3.] Refresh your browser and let the changes take effect.<br />
<br />
<strong>- Codes without WWW.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</strong></p>
<pre class="brush: vb; title: ; notranslate">
&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
#Options +FollowSymLinks
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
&lt;/IfModule&gt;
</pre>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
<br />
<strong>- Codes with WWW.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</strong></p>
<pre class="brush: vb; title: ; notranslate">
&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
#Options +FollowSymLinks
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [R=301,L]
&lt;/IfModule&gt;
</pre>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
<br />
<strong>Copyrighted by Lair360</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://lair360.co.uk/blog/678/hta-ceo-friendly-redirects/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to redirect non – encrypted webpage to SSL</title>
		<link>http://lair360.co.uk/blog/659/how-to-redirect-non-%e2%80%93-encrypted-webpage-to-ssl-encrypted-webpage/</link>
		<comments>http://lair360.co.uk/blog/659/how-to-redirect-non-%e2%80%93-encrypted-webpage-to-ssl-encrypted-webpage/#comments</comments>
		<pubDate>Mon, 31 Aug 2009 12:44:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HTA Script]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[encrypted webpage]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[private ip address]]></category>
		<category><![CDATA[REQUEST_FILENAME]]></category>
		<category><![CDATA[REQUEST_URI]]></category>
		<category><![CDATA[SERVER_PORT]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://lair360.co.uk/blog/?p=659</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://lair360.co.uk/blog/659/how-to-redirect-non-%e2%80%93-encrypted-webpage-to-ssl-encrypted-webpage/' addthis:title='How to redirect non – encrypted webpage to SSL ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>Version: 13.1b Revision: 43 Build 12 How to redirect non – encrypted webpage to ssl encrypted webpage Introduction: when I was repairing my website and directories, I’ve managed to re-direct all of my webpages to SSL encrypted pages. However, this techniques requires “htaccess” script for redirecting webpage. This will only work with a private IP [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://lair360.co.uk/blog/659/how-to-redirect-non-%e2%80%93-encrypted-webpage-to-ssl-encrypted-webpage/' addthis:title='How to redirect non – encrypted webpage to SSL ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div><p><strong>Version: 13.1b<br />
Revision: 43 Build 12<br />
<br />
How to redirect non – encrypted webpage to ssl encrypted webpage<br />
<br />
Introduction:</strong> when I was repairing my website and directories, I’ve managed to re-direct all of my webpages to SSL encrypted pages. However, this techniques requires “htaccess” script for redirecting webpage. This will only work with a private IP address + SSL supported server.<br />
<br />
<strong>Notes:</strong> for this to work, you must have a private IP address and a working SSL certificate. These can be obtained by the hosting provider.<br />
Just talk to them and they will sort these out for you. When you’re done, you can read this tutorial…<br />
<br />
1.] Execute your FTP application and log-in. Wait for the server to connect and navigate yourself to your WordPress directory. After that, you must look for your htaccess files and transfer them to your hard drive. When you’re done with this procedure, please execute your htaccess file (from your hard drive) and make sure that you have this or something that is / are similar.</p>
<pre class="brush: php; title: ; notranslate">
&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
#Options +FollowSymlinks
RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
&lt;/IfModule&gt;
# END WordPress
</pre>
<p>2.] If you have the source, which is shown above, please add this below “# END WordPress” and save your work.</p>
<pre class="brush: php; title: ; notranslate">
&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} wp-login.php
RewriteRule ^(.*)$ https://webpages.co.uk/blog/$1 [R,L]
&lt;/IfModule&gt;
&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} wp-admin
RewriteRule ^(.*)$ https://webpages.co.uk/blog/$1 [R,L]
&lt;/IfModule&gt;
</pre>
<p><strong>Notes:</strong> if you want your entire blog to be encrypted, please use this source provided. But, you must alter “webpages.co.uk” with your own website / domain. Also, the default port is 80. But, if there is a problem with your ports, please consult your problems with your hosting provider.</p>
<pre class="brush: php; title: ; notranslate">
&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} blog
RewriteRule ^(.*)$ https://webpages.co.uk/$1 [R,L]
&lt;/IfModule&gt;
</pre>
<p>3.] Save your progress and delete your old htaccess file (which is from your server). When you’re done, please double check your server and upload your modified htaccess file. After that, you must clear your internet temporary files and check your website.<br />
<br />
4.] Done!<br />
<br />
<strong>Copyrighted by Lair360</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://lair360.co.uk/blog/659/how-to-redirect-non-%e2%80%93-encrypted-webpage-to-ssl-encrypted-webpage/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to remove world wide web &#8211; WWW</title>
		<link>http://lair360.co.uk/blog/567/how-to-remove-world-wide-web-www/</link>
		<comments>http://lair360.co.uk/blog/567/how-to-remove-world-wide-web-www/#comments</comments>
		<pubDate>Sun, 03 May 2009 21:22:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HTA Script]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[remove www]]></category>
		<category><![CDATA[world wide web]]></category>

		<guid isPermaLink="false">http://lair360.co.uk/blog/?p=567</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://lair360.co.uk/blog/567/how-to-remove-world-wide-web-www/' addthis:title='How to remove world wide web &#8211; WWW ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>Version: 13.1 Revision: 22 Build 12c How to remove world wide web &#8211; WWW Introduction: everyday in my life, there are hundreds of users, who would like to get rid of this annoying “world wide web”, which is located on their hosting services and the address bar. These strings can be remove by using “htaccess” [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://lair360.co.uk/blog/567/how-to-remove-world-wide-web-www/' addthis:title='How to remove world wide web &#8211; WWW ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div><p><strong>Version: 13.1<br />
Revision: 22 Build 12c<br />
<br />
How to remove world wide web &#8211; WWW<br />
<br />
Introduction:</strong> everyday in my life, there are hundreds of users, who would like to get rid of this annoying “world wide web”, which is located on their hosting services and the address bar. These strings can be remove by using “htaccess” commands, to redirect a web-link into an url without “www”.<br />
<br />
<strong>Example:</strong> all urls will be redirect by the ‘htaccess’ files, from “www.example.com” to “example.com”, even if the “www” is typed into the address box.<br />
<br />
1.] Create a single “.htaccess” file or add this code into the top of your “.htaccess” file.<br />
But, you must delete your old “htaccess” files (server files) before you transfer it into your hosting server. If you overwrite it, the codes will not work…<br />
<br />
<strong>&#8212;Copy Source Code&#8212;</strong></p>
<pre class="brush: plain; title: ; notranslate">
&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
Options +FollowSymLinks
RewriteCond %{HTTP_HOST} ^www\.example\.come$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]
&lt;/IfModule&gt;
</pre>
<p><strong>&#8212;End Source Code&#8212;</strong><br />
<br />
<strong>Notes:</strong> replace &#8220;example&#8221; with your own domain names (before you import). After that, just clear your internet browsers&#8217; temporary files and caches.<br />
<br />
2.] Check your website by typing the urls with &#8220;www&#8221; and see it for yourself.<br />
<br />
3.] Finish!<br />
<br />
<strong>Tips:</strong> if you want to be smart and keep your page rank from being slaughter, you can use this htaccess methods to hide this problem.<br />
<br />
<strong>&#8212;Copy Source Code&#8212;</strong></p>
<pre class="brush: plain; title: ; notranslate">
&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
#Options +FollowSymLinks
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
&lt;/IfModule&gt;
</pre>
<p><strong>&#8212;End Source Code&#8212;</strong><br />
<br />
<strong>Notes:</strong> just remove the &#8220;#&#8221; symbol, if you want to activate &#8220;FollowSymLinks&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://lair360.co.uk/blog/567/how-to-remove-world-wide-web-www/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RewriteEngine &#8211; Blocking Robots v3</title>
		<link>http://lair360.co.uk/blog/519/rewriteengine-blocking-robots-v3/</link>
		<comments>http://lair360.co.uk/blog/519/rewriteengine-blocking-robots-v3/#comments</comments>
		<pubDate>Sat, 14 Mar 2009 21:57:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HTA Script]]></category>
		<category><![CDATA[PHP & HTML Script]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[block robots]]></category>
		<category><![CDATA[block spam robot]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[RewriteCond]]></category>
		<category><![CDATA[RewriteEngine]]></category>

		<guid isPermaLink="false">http://lair360.co.uk/blog/?p=519</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://lair360.co.uk/blog/519/rewriteengine-blocking-robots-v3/' addthis:title='RewriteEngine &#8211; Blocking Robots v3 ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>Version: 41.1s Revision: 141 Build 46 RewriteEngine &#8211; Blocking Robots v3 Introduction: this powerful &#8216;htaccess&#8217; script was designed and tested for 2 months. It was a successful project and it&#8217;s free for use! However, you must have &#8220;RewriteEngine&#8221; enabled for the process to work! 1.] Download notepad++ from the original author or from a mirror [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://lair360.co.uk/blog/519/rewriteengine-blocking-robots-v3/' addthis:title='RewriteEngine &#8211; Blocking Robots v3 ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div><p><strong>Version: 41.1s<br />
Revision: 141 Build 46<br />
<br />
RewriteEngine &#8211; Blocking Robots v3<br />
<br />
Introduction:</strong> this powerful &#8216;htaccess&#8217; script was designed and tested for 2 months.<br />
It was a successful project and it&#8217;s free for use! However, you must have &#8220;RewriteEngine&#8221; enabled for the process to work!<br />
<br />
1.] Download notepad++ from the original author or from a mirror and install the software.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>http://sourceforge.net/projects/notepad-plus/</p>
<p>http://filehippo.com/download_notepad/</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
<br />
2.] Copy this &#8220;ANSI &#8211; script&#8221; and save it as a &#8220;.htaccess&#8221; extension.<br />
<br />
<strong>Notes:</strong> if you want to cancel any robots or harvester from being block, you&#8217;ll need to add the comment symbol &#8220;#&#8221; (without the quotes).<br />
<br />
<strong>Advice:</strong> To activate the script, please unmark the comment symbol (#) from line two and three. That is all&#8230;<br />
<br />
<strong>&#8212;Copy Source Code&#8212;</strong></p>
<pre class="brush: xml; title: ; notranslate">
# -blockBots-
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_USER_AGENT} ^web.?(auto|bandit|collector|copier|devil|hook|mole|miner|mirror|reaper|sauger|sucker|site|snake|stripper|weasel) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Alphared [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^BlackWidow [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Bot\ mailto:craftbot@yahoo.com [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^SapphireWebCrawler\ Nuch [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^ChinaClaw [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Custo [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^AsiaNetBot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^RealDownload [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^DISCo [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Download\ Demon [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^DIIbot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^eCatch [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^EirGrabber [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^EmailSiphon [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^EmailWolf [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^EmailCollector [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Express\ WebPictures [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^ExtractorPro [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^EyeNetIE [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^FlashGet [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^GetRight [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^GetWeb! [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Go!Zilla [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Go-Ahead-Got-It [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^GrabNet [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Grafula [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^PERL/? [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^HMView [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Indy.Library [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Image\ Stripper [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Image\ Sucker [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Indy\ Library [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^InterGET [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Internet\ Ninja [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^InternetSeer.com [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^JetCar [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^JOC\ Web\ Spider [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^larbin [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^LeechFTP [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Mass\ Downloader [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^MIDown\ tool [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Mister\ PiX [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Navroad [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^NearSite [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^NetAnts [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^NetSpider [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Net\ Vampire [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^NetZIP [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Octopus [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Offline\ Explorer [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Offline\ Navigator [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^PageGrabber [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Papa\ Foto [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^pavuk [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^RADIAN6.com [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^R6_ [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^pcBrowser [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^RealDownload [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^ReGet [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^SiteSnagger [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^SmartDownload [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^SuperBot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^SuperHTTP [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Surfbot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^tAkeOut [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Teleport\ Pro [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^VoidEYE [OR]
RewriteCond %{HTTP_USER_AGENT} ^Web\ Image\ Collector [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Web\ Sucker [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^WebAuto [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^WebCopier [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^WebFetch [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^WebGo\ IS [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^WebLeacher [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^WebReaper [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^WebSauger [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^WIKIOFEED\ wikio.com [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^JAVA [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Java/1.4.1_ [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^JAVA/1.6.0_ [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^JAVA/1\.* [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Website\ eXtractor [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Website\ Quester [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^WebStripper [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^WebWhacker [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^WebZIP [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Wget [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^WhosTalking [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Widow [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^WebEnhancer [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^WWWOFFLE [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Xaldon\ WebSpider [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Zeus [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^vayala [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^EATRSSFEEDHUNGRYSPIDER\* [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^TurnitinBot [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^psbot [NC]
RewriteRule ^.* - [F,L]
</pre>
<p><strong>&#8212;End Source Code&#8212; </strong><br />
<br />
3.] Remove the old file from your server and upload your new version!<br />
<br />
4.] Done!<br />
<br />
<strong>Notes:</strong> if you want to download the files, you can use this link instead: http://www.2shared.com/file/5082668/bfa5c0cc/Blocking_Robots.html<br />
<br />
<strong>Copyrighted by Lair360</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://lair360.co.uk/blog/519/rewriteengine-blocking-robots-v3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mod_deflate.c &#8211; compress webpages and files</title>
		<link>http://lair360.co.uk/blog/475/mod_deflatec-compress-webpages-and-files/</link>
		<comments>http://lair360.co.uk/blog/475/mod_deflatec-compress-webpages-and-files/#comments</comments>
		<pubDate>Fri, 06 Mar 2009 18:08:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HTA Script]]></category>
		<category><![CDATA[HTML and Frontpage]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[compress]]></category>
		<category><![CDATA[compress wordpress]]></category>
		<category><![CDATA[DeflateCompressionLevel]]></category>
		<category><![CDATA[DeflateMemlevel]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[mod_deflate.c]]></category>

		<guid isPermaLink="false">http://lair360.co.uk/blog/?p=475</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://lair360.co.uk/blog/475/mod_deflatec-compress-webpages-and-files/' addthis:title='Mod_deflate.c &#8211; compress webpages and files ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>Version: 43.1 Revision: 13 Build 11 Mod_deflate.c &#8211; compress webpages and files Introduction: from my previous article, I was writing my favourite tutorial about “Gzip” compression for Apache v1.3xx or above. But, this time I would be writing: “mod_deflate.c” which is designed for Apache v2.0xx or above. Notes: older browser may cause problems with “mod_deflate” [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://lair360.co.uk/blog/475/mod_deflatec-compress-webpages-and-files/' addthis:title='Mod_deflate.c &#8211; compress webpages and files ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div><p><strong>Version: 43.1<br />
Revision: 13 Build 11<br />
<br />
Mod_deflate.c &#8211; compress webpages and files<br />
<br />
Introduction:</strong> from my previous article, I was writing my favourite tutorial about “Gzip” compression for Apache v1.3xx or above. But, this time I would be writing: “mod_deflate.c” which is designed for Apache v2.0xx or above.<br />
<br />
<strong>Notes:</strong> older browser may cause problems with “mod_deflate” compression.<br />
Nevertheless, if you are using these browsers: “IE5, IE6, IE7, Opera 8 &#038; 9, Safari, Camino &#038; FF1 &#038; FF2”, then you are not effected!<br />
<br />
1.] Download notepad++ from the original author or from a mirror and install the software.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>http://sourceforge.net/projects/notepad-plus/</p>
<p>http://filehippo.com/download_notepad/</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
<br />
2.] Copy one of these codes and insert at the very top of the &#8220;.htaccess&#8221; file.<br />
However, please delete your old &#8220;.htaccess&#8221; files before uploading&#8230;<br />
<br />
a.] match a certain type of files or extension and compress (v1).<br />
<strong>&#8212;Copy Source Code&#8212;</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;IfModule mod_deflate.c&gt;
&lt;FilesMatch &quot;\\.(js|css|html|htm|php|xml)$&quot;&gt;
SetOutputFilter DEFLATE
&lt;/FilesMatch&gt;
&lt;/IfModule&gt;
</pre>
<p><strong>&#8212;End Source Code&#8212;</strong><br />
<br />
b.] deflate individual files (manually) and exclude the rest&#8230;<br />
<strong>&#8212;Copy Source Code&#8212;</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;IfModule mod_deflate.c&gt;
&lt;Location /&gt;
# Files and Text to compress
#***************************
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/x-httpd-php
AddOutputFilterByType DEFLATE application/x-httpd-fastphp
AddOutputFilterByType DEFLATE application/x-httpd-eruby
# Files and Text to exclude from compression
#***************************
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.avi$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.mov$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.mp3$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.mp4$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.rm$ no-gzip dont-vary
&lt;/Location&gt;
&lt;/IfModule&gt;
</pre>
<p><strong>&#8212;End Source Code&#8212;<br />
<br />
Notes:</strong> please remove the ones which you don&#8217;t need or require.<br />
<br />
c.] compress a specific directory&#8230;<br />
<strong>&#8212;Copy Source Code&#8212;</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;IfModule mod_deflate.c&gt;
&lt;Directory &quot;/static/help&quot;&gt;
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
&lt;/Directory&gt;
&lt;/IfModule&gt;
</pre>
<p><strong>&#8212;End Source Code&#8212;</strong><br />
<br />
e.] using &#8220;mod_deflate.c&#8221; and disable buggy browser from compressing data.<br />
<strong>&#8212;Copy Source Code&#8212;</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;IfModule mod_deflate.c&gt;
  # Compress contents that of a certain type
  AddOutputFilterByType DEFLATE text/plain
  AddOutputFilterByType DEFLATE text/xml
  AddOutputFilterByType DEFLATE application/xhtml+xml
  AddOutputFilterByType DEFLATE text/css
  AddOutputFilterByType DEFLATE application/xml
  AddOutputFilterByType DEFLATE image/svg+xml
  AddOutputFilterByType DEFLATE application/rss+xml
  AddOutputFilterByType DEFLATE application/atom_xml
  AddOutputFilterByType DEFLATE application/x-javascript
  AddOutputFilterByType DEFLATE application/x-httpd-php
  AddOutputFilterByType DEFLATE application/x-httpd-fastphp
  AddOutputFilterByType DEFLATE application/x-httpd-eruby
  AddOutputFilterByType DEFLATE text/html

# Files and Text to exclude from compression
#***************************
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.avi$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.mov$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.mp3$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.mp4$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.rm$ no-gzip dont-vary

# Properly handle old browsers that doesn't support compression
  BrowserMatch ^Mozilla/4 gzip-only-text/html
  BrowserMatch ^Mozilla/4\.0[678] no-gzip
  BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
&lt;/IfModule&gt;
</pre>
<p><strong>&#8212;End Source Code&#8212;</strong><br />
<br />
f.] compress all types of extension and exclude the rest (v2).<br />
<strong>&#8212;Copy Source Code&#8212;</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;IfModule mod_deflate.c&gt;
&lt;Location /&gt;
    SetOutputFilter DEFLATE
      SetEnvIfNoCase Request_URI  \\.(?:gif|jpe?g|png)$ no-gzip dont-vary
      	SetEnvIfNoCase Request_URI  \\.(?:exe|t?gz|zip|gz2|sit|rar)$ no-gzip dont-vary
	&lt;/Location&gt;
&lt;/IfModule&gt;
</pre>
<p><strong>&#8212;End Source Code&#8212;</strong><br />
<br />
e.] Compress everything with &#8220;DeflateFilterNote&#8221;. However, this is optional&#8230;<br />
<strong>&#8212;Copy Source Code&#8212;</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;IfModule mod_deflate.c&gt;
SetOutputFilter DEFLATE
DeflateFilterNote ratio
	SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
	SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
	SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
&lt;/IfModule&gt;
</pre>
<p><strong>&#8212;End Source Code&#8212;</strong><br />
<br />
f.] Deflate everything with browser support (mostly for older browser).<br />
<strong>&#8212;Copy Source Code&#8212;</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;IfModule mod_deflate.c&gt;
SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
&lt;/IfModule&gt;
</pre>
<p><strong>&#8212;End Source Code&#8212;</strong><br />
<br />
g.] This is one of my version, which I was using from my previous server, in-fact, it was a very well built version. However, there two big setback&#8230;<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
1.] To allow compression from a proxy client, you&#8217;ll need to install &#8220;mod_headers.so&#8221;.<br />
Without this &#8220;mod_engine.so&#8221;, there might be some errors and conflicts if you&#8217;re behind a &#8216;proxy&#8217; server!<br />
<br />
2.] You&#8217;ll need to remove some parts and stitch them up by pieces.<br />
Nevertheless, if you don&#8217;t know, please use the above codes&#8230;<br />
<strong>&#8212;Copy Source Code&#8212;</strong></p>
<pre class="brush: php; title: ; notranslate">
# Version: 31
# Apache Version: 2.1xxx
#*******************************

# Method 1 - Only compress specified content type
&lt;Location /&gt;
  &lt;IfModule mod_deflate.c&gt;
    # compress content with type html, text, and css
    AddOutputFilterByType DEFLATE text/html text/plain text/css
    &lt;IfModule mod_headers.c&gt;
      # properly handle requests coming from behind proxies
      Header append Vary User-Agent
    &lt;/IfModule&gt;
  &lt;/IfModule&gt;
&lt;/Location&gt;

# Method 2 - Compress all content, manually excluding specified file types
&lt;IfModule mod_deflate.c&gt;
  # place filter 'DEFLATE' on all outgoing content
  SetOutputFilter DEFLATE
  # exclude uncompressible content via file type
  SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|rar|zip)$ no-gzip dont-vary
  &lt;IfModule mod_headers.c&gt;
    # properly handle requests coming from behind proxies
    Header append Vary User-Agent
  &lt;/IfModule&gt;
&lt;/IfModule&gt;

# deflate.log.
# log compression ratio on each request
&lt;IfModule mod_deflate.c&gt;
  DeflateFilterNote Input instream
  DeflateFilterNote Output outstream
  DeflateFilterNote Ratio ratio
  LogFormat '&quot;%r&quot; %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
  CustomLog logs/deflate.log deflate
&lt;/IfModule&gt;

# Properly handle old browsers that do not support compression
&lt;IfModule mod_deflate.c&gt;
  BrowserMatch ^Mozilla/4 gzip-only-text/html
  BrowserMatch ^Mozilla/4\.0[678] no-gzip
  BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
&lt;/IfModule&gt;
</pre>
<p><strong>&#8212;End Source Code&#8212;</strong><br />
<br />
h.] This is my final version. But, lets just say: &#8216;it&#8217;s a little bonus for everyone to enjoy&#8230;&#8217;<br />
<br />
<strong>Notes:</strong> this &#8220;htaccess&#8221; script has browser support (for older browser), Log format and deflate compression level.<br />
<br />
<strong>DeflateCompressionLevel 1</strong><br />
<br />
<strong>Warning: </strong>setting your &#8220;compression level + memory level&#8221; from 1 to 9, this could destroy your data, triggers errors and accessive bandwidth. So, please consider your compression level before you continue.<br />
<strong>&#8212;Copy Source Code&#8212;</strong></p>
<pre class="brush: php; title: ; notranslate">
# Version: 45.1 [Final]
# mod_deflate engine
#*****************************
&lt;IfModule mod_deflate.c&gt;
        AddOutputFilterByType DEFLATE text/plain
        AddOutputFilterByType DEFLATE text/html
        AddOutputFilterByType DEFLATE text/xml
        AddOutputFilterByType DEFLATE text/css
        AddOutputFilterByType DEFLATE application/xml
        AddOutputFilterByType DEFLATE application/xhtml+xml
        AddOutputFilterByType DEFLATE application/rss+xml
        AddOutputFilterByType DEFLATE application/javascript
        AddOutputFilterByType DEFLATE application/x-javascript
        DeflateCompressionLevel 9
	DeflateMemlevel 9
        BrowserMatch ^Mozilla/4 gzip-only-text/html
        BrowserMatch ^Mozilla/4\.0[678] no-gzip
        BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
        DeflateFilterNote Input instream
        DeflateFilterNote Output outstream
        DeflateFilterNote Ratio ratio
        LogFormat '&quot;%r&quot; %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
&lt;/IfModule&gt;
</pre>
<p><strong>&#8212;End Source Code&#8212;</strong><br />
<br />
i.] This version was created for advance users. However, please be careful about the compression level. They can also eat up your server&#8217;s memory and CPU usage!<br />
<br />
<strong>&#8212;Copy Source Code&#8212;</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;IfModule mod_deflate.c&gt;
SetOutputFilter DEFLATE
DeflateFilterNote ratio
DeflateCompressionLevel 9
DeflateMemlevel 9
DeflateWindowSize 15
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar|Z)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
&lt;/IfModule&gt;
</pre>
<p><strong>&#8212;End Source Code&#8212;</strong><br />
<br />
3.] Save your &#8220;htaccess&#8221; file and upload it to your server.<br />
But, don&#8217;t forget to delete the old version before uploading!!<br />
<br />
4.] Done!<br />
<br />
<strong>Notes:</strong> please check your website if you have compression enabled&#8230;<br />
</p>
<p>http://www.seoconsultants.com/tools/compression.asp</p>
<p>
<strong>Tips:</strong> if you&#8217;re getting an error, please try this method&#8230;<br />
<strong>&#8212;Copy Source Code&#8212;</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;Location /&gt;
&lt;IfModule mod_deflate.c&gt;
SetOutputFilter DEFLATE
DeflateFilterNote ratio
DeflateCompressionLevel 9
DeflateMemlevel 9
DeflateWindowSize 15
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar|Z)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
&lt;/IfModule&gt;
&lt;/Location&gt;
</pre>
<p><strong>&#8212;End Source Code&#8212;</strong><br />
<br />
<strong>Copyrighted by Lair360</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://lair360.co.uk/blog/475/mod_deflatec-compress-webpages-and-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gzip &#8211; compress webpages and files</title>
		<link>http://lair360.co.uk/blog/468/gzip-compress-webpages-and-files/</link>
		<comments>http://lair360.co.uk/blog/468/gzip-compress-webpages-and-files/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 19:10:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HTA Script]]></category>
		<category><![CDATA[HTML and Frontpage]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[deflate]]></category>
		<category><![CDATA[deflate webpages]]></category>
		<category><![CDATA[Gzip]]></category>
		<category><![CDATA[gzip compression]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[mod_gzip]]></category>
		<category><![CDATA[mod_gzip.c]]></category>

		<guid isPermaLink="false">http://lair360.co.uk/blog/?p=468</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://lair360.co.uk/blog/468/gzip-compress-webpages-and-files/' addthis:title='Gzip &#8211; compress webpages and files ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>Version: 43.1 Revision: 13 Build 11 Gzip &#8211; compress webpages and files Introduction: when I was writing another article, I was thinking about a small box that could fit many things inside without force. So, I decided to write a big article that will enable you to compress your html, php, css and javascript files [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://lair360.co.uk/blog/468/gzip-compress-webpages-and-files/' addthis:title='Gzip &#8211; compress webpages and files ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div><p><strong>Version: 43.1<br />
Revision: 13 Build 11<br />
<br />
Gzip &#8211; compress webpages and files<br />
<br />
Introduction:</strong> when I was writing another article, I was thinking about a small box that could fit many things inside without force. So, I decided to write a big article that will enable you to compress your html, php, css and javascript files without looking at a book! However, you&#8217;ll need make sure that you have &#8220;mod_gzip.c&#8221; enabled by your server provider, if not, you&#8217;ll need to notify them or ask them if &#8220;Gzip.c&#8221; was enabled.<br />
<br />
1.] Download notepad++ from the original author or from a mirror and install the software.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>http://sourceforge.net/projects/notepad-plus/</p>
<p>http://filehippo.com/download_notepad/</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
<br />
2.] Copy one of these codes and insert at the very top of the &#8220;.htaccess&#8221; file.<br />
However, please delete your old &#8220;.htaccess&#8221; files before uploading&#8230;<br />
<br />
a.] Compress a certain file type &#8211; extension.<br />
<strong>&#8212;Copy Source Code&#8212;</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;IfModule mod_gzip.c&gt;
&lt;Files *.html&gt;
    SetOutputFilter DEFLATE
&lt;/Files&gt;
&lt;/IfModule&gt;
</pre>
<p><strong>&#8212;End Source Code&#8212;</strong><br />
<br />
b.] Compress multiple type of contents.<br />
<br />
<strong>Notes:</strong> the lines: &#8220;no-gzip dont-vary&#8221; was added to exclude certain types of files.<br />
This is useful if you don&#8217;t want a particular file to be compress&#8230;<br />
&#8212;Copy Source Code&#8212;</p>
<pre class="brush: php; title: ; notranslate">
&lt;IfModule mod_gzip.c&gt;
&lt;Location /&gt;
    SetOutputFilter DEFLATE
      SetEnvIfNoCase Request_URI  \
	\.(?:gif|jpe?g|png)$ no-gzip dont-vary
    SetEnvIfNoCase Request_URI  \
	\.(?:exe|t?gz|zip|gz2|sit|rar)$ no-gzip dont-vary
&lt;/Location&gt;
&lt;/IfModule&gt;
</pre>
<p><strong>&#8212;End Source Code&#8212;</strong></p>
<p>c.] Compress certain types of extension in one slot.<br />
<strong>&#8212;Copy Source Code&#8212;</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;IfModule mod_gzip.c&gt;
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/xhtml+xml
&lt;FilesMatch &quot;\\.(js|css|html|htm|xml)$&quot;&gt;
    SetOutputFilter DEFLATE
	&lt;/FilesMatch&gt;
&lt;/IfModule&gt;
</pre>
<p><strong>&#8212;End Source Code&#8212;</strong><br />
<br />
d.] This script is for older apache model (version: 1.3xx).<br />
<strong>&#8212;Copy Source Code&#8212;</strong></p>
<pre class="brush: php; title: ; notranslate">
# GZIP FOR APACHE 1.3.x SERVERS
&lt;IfModule mod_gzip.c&gt;
mod_gzip_on       Yes
mod_gzip_dechunk  Yes
    mod_gzip_item_include file \.htm$
    mod_gzip_item_include file \.html$
    mod_gzip_item_include file \.php$
    mod_gzip_item_include file \.txt$
    mod_gzip_item_include mime ^text/.*
    mod_gzip_item_include file \.js$
    mod_gzip_item_include file \.css$
    mod_gzip_item_include file \.rdf$
    mod_gzip_item_include file \.xml$
    mod_gzip_item_include file \.rss$
    mod_gzip_item_include mime ^application/x-httpd-php
    mod_gzip_item_include mime ^application/x-javascript
    mod_gzip_item_include mime ^application/javascript
    mod_gzip_item_include mime ^text/css$
    mod_gzip_item_include mime ^text/plain$
    mod_gzip_item_include mime ^text/xml$
	mod_gzip_item_exclude mime      ^image/.*
	mod_gzip_item_exclude file \.flv$
	mod_gzip_item_exclude file \.pdf$

&lt;/IfModule&gt;
</pre>
<p><strong>&#8212;End Source Code&#8212;</strong><br />
<br />
e.] this is a portable version and it compress files that ends with a specific extension.<br />
<strong>&#8212;Copy Source Code&#8212;</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;IfModule mod_gzip.c&gt;
  &lt;FilesMatch &quot;\.(css|js|x?html?)$&quot;&gt;
	SetOutputFilter DEFLATE
  &lt;/FilesMatch&gt;
&lt;/IfModule&gt;
</pre>
<p><strong>&#8212;End Source Code&#8212;</strong><br />
<br />
f.] This is another alternative and it does work.<br />
But, this time, the compression engine will support older browser!<br />
&#8212;Copy Source Code&#8212;</p>
<pre class="brush: php; title: ; notranslate">
&lt;Ifmodel mod_gzip.c&gt;
&lt;Location /&gt;
    SetOutputFilter DEFLATE
      SetEnvIfNoCase Request_URI  \
        \.(?:gif|jpe?g|png)$ no-gzip dont-vary
    SetEnvIfNoCase Request_URI  \
        \.(?:exe|t?gz|zip|gz2|sit|rar)$ no-gzip dont-vary
&lt;/Location&gt;
# Deactivate compression for buggy browsers
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
&lt;/IfModule&gt;
</pre>
<p><strong>&#8212;End Source Code&#8212;</strong><br />
<br />
g.] This is my last version which includes &#8220;cgi-script&#8221; and exclude&#8221;rspheader&#8221; for the compression engine.<br />
<strong>&#8212;Copy Source Code&#8212;</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;IfModule mod_gzip.c&gt;
    mod_gzip_on       Yes
    mod_gzip_dechunk  Yes
    mod_gzip_item_include file      \.(html?|txt|css|js|php|ini)$
    mod_gzip_item_include handler   ^cgi-script$
    mod_gzip_item_include mime      ^text/.*
    mod_gzip_item_include mime      ^application/x-javascript.*
    mod_gzip_item_exclude mime     ^application/xml
    mod_gzip_item_exclude mime     ^image/.*
    mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
&lt;/IfModule&gt;
</pre>
<p><strong>&#8212;End Source Code&#8212;</strong><br />
<br />
e.] This is my own favorite. But, guess what?<br />
It works!<br />
<strong>&#8212;Copy Source Code&#8212;</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;IfModule mod_gzip.c&gt;
SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
&lt;/IfModule&gt;
</pre>
<p><strong>&#8212;End Source Code&#8212;</strong><br />
<br />
<strong>Notes:</strong> if you want to modify your compression level, just add this code.<br />
But, the maximum level &#8211; compression is 9.<br />
<strong>&#8212;Copy Source Code&#8212;</strong></p>
<pre class="brush: php; title: ; notranslate">
DeflateCompressionLevel 3
</pre>
<p><strong>&#8212;End Source Code&#8212;</strong><br />
<br />
3.] Save your &#8220;htaccess&#8221; file and upload it to your server.<br />
But, don&#8217;t forget to delete the old version before uploading!!<br />
<br />
4.] Done!<br />
<br />
<strong>Notes:</strong> if you want to check your Apache&#8217;s information and installed module, then, please use this code&#8230;<br />
<strong>&#8212;Copy Source Code&#8212;</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
phpinfo();
?&gt;
</pre>
<p><strong>&#8212;End Source Code&#8212;</strong><br />
<br />
<strong>Copyrighted by Lair360</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://lair360.co.uk/blog/468/gzip-compress-webpages-and-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

