<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1343133296744135180</id><updated>2012-01-14T07:32:11.950+07:00</updated><category term='Monetize'/><category term='Niche'/><category term='General'/><category term='SEO'/><category term='Blogging'/><title type='text'>Speedybiz Online Journal</title><subtitle type='html'>Webmaster Daily Online Activity - Surf Read Write &amp;amp; Practice</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://speedybiz.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1343133296744135180/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://speedybiz.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>speedybiz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp1.blogger.com/_RJhWWe1VrV8/SFFGoy0rStI/AAAAAAAAAAU/aOr375h3bXI/S220/speedybiz_superhero.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>11</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1343133296744135180.post-3923669811144041895</id><published>2008-07-04T06:37:00.000+07:00</published><updated>2012-01-14T07:15:27.831+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SEO'/><title type='text'>Ultimate htaccess Examples</title><content type='html'>This lets google crawl the page, lets me access the whole site (24.205.23.222) without a password, and lets my client access the page WITH a password. It also allows for XHTML and CSS validation! (w3.org)&lt;br /&gt;&lt;br /&gt;# ELITE HTACCESS FOR WEBDEVELOPERS&lt;br /&gt;##############################################&lt;br /&gt;AuthName "SiteName Administration"&lt;br /&gt;AuthUserFile /home/sitename.com/.htpasswd&lt;br /&gt;AuthType basic&lt;br /&gt;Require valid-user&lt;br /&gt;Order deny,allow&lt;br /&gt;Deny from all&lt;br /&gt;Allow from 24\.205\.23\.222&lt;br /&gt;Allow from w3.org htmlhelp.com&lt;br /&gt;Allow from googlebot.com&lt;br /&gt;Satisfy Any&lt;br /&gt;&lt;br /&gt;Each code snippet has been copied from htaccesselite. Additional and detailed info on each htaccess code snippet can be found at askapache.com&lt;br /&gt;&lt;br /&gt;NOTE: Most of these snippets can be used with a Files or Filesmatch directive to only apply to certain files.&lt;br /&gt;&lt;br /&gt;NOTE: Any htaccess rewrite examples should always begin with:&lt;br /&gt;Options +FollowSymLinks&lt;br /&gt;RewriteEngine On&lt;br /&gt;RewriteBase /&lt;br /&gt;Apache Documentation: 1.3 | 2.0 | 2.2 | Current&lt;br /&gt;Make any file be a certain filetype (regardless of name or extension)&lt;br /&gt;#Makes image.gif, blah.html, index.cgi all act as php&lt;br /&gt;ForceType application/x-httpd-php&lt;br /&gt;Redirect non-https requests to https server fixing double-login problem and ensuring that htpasswd authorization can only be entered using HTTPS&lt;br /&gt;&lt;br /&gt;Additional https/ssl information and Apache SSL in htaccess examples&lt;br /&gt;SSLOptions +StrictRequire&lt;br /&gt;SSLRequireSSL&lt;br /&gt;SSLRequire %{HTTP_HOST} eq "google.com"&lt;br /&gt;ErrorDocument 403 https://google.com&lt;br /&gt;SEO Friendly redirects for bad/old links and moved links&lt;br /&gt;For single moved file&lt;br /&gt;Redirect 301 /d/file.html http://www.htaccesselite.com/r/file.html&lt;br /&gt;For multiple files like a blog/this.php?gh&lt;br /&gt;RedirectMatch 301 /blog(.*) http://www.askapache.com/$1&lt;br /&gt;different domain name&lt;br /&gt;Redirect 301 / http://www.newdomain.com&lt;br /&gt;Require the www&lt;br /&gt;Options +FollowSymLinks&lt;br /&gt;RewriteEngine On&lt;br /&gt;RewriteBase /&lt;br /&gt;RewriteCond %{REQUEST_URI} !^/robots\.txt$&lt;br /&gt;RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]&lt;br /&gt;RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]&lt;br /&gt;Require the www without hardcoding&lt;br /&gt;Options +FollowSymLinks&lt;br /&gt;RewriteEngine On&lt;br /&gt;RewriteBase /&lt;br /&gt;RewriteCond %{REQUEST_URI} !^/robots\.txt$ [NC]&lt;br /&gt;RewriteCond %{HTTP_HOST} !^www\.[a-z-]+\.[a-z]{2,6} [NC]&lt;br /&gt;RewriteCond %{HTTP_HOST} ([a-z-]+\.[a-z]{2,6})$ [NC]&lt;br /&gt;RewriteRule ^/(.*)$ http://%1/$1 [R=301,L]&lt;br /&gt;Require no subdomain&lt;br /&gt;Options +FollowSymLinks&lt;br /&gt;RewriteEngine On&lt;br /&gt;RewriteBase /&lt;br /&gt;RewriteCond %{REQUEST_URI} !^/robots\.txt$&lt;br /&gt;RewriteCond %{HTTP_HOST} \.([a-z-]+\.[a-z]{2,6})$ [NC]&lt;br /&gt;RewriteRule ^/(.*)$ http://%1/$1 [R=301,L]&lt;br /&gt;Require no subdomain&lt;br /&gt;Options +FollowSymLinks&lt;br /&gt;RewriteEngine On&lt;br /&gt;RewriteBase /&lt;br /&gt;RewriteCond %{HTTP_HOST} \.([^\.]+\.[^\.0-9]+)$&lt;br /&gt;RewriteCond %{REQUEST_URI} !^/robots\.txt$ [NC]&lt;br /&gt;RewriteRule ^(.*)$ http://%1/$1 [R=301,L]&lt;br /&gt;Redirect everyone to different site except 1 IP address (useful for web-development)&lt;br /&gt;ErrorDocument 403 http://www.someothersite.com&lt;br /&gt;Order deny,allow&lt;br /&gt;Deny from all&lt;br /&gt;Allow from 24.33.65.6&lt;br /&gt;CHMOD your files&lt;br /&gt;&lt;br /&gt;chmod .htpasswd files 640 chmod .htaccess files 644 chmod php files 600 chmod files that you really dont want people to see as 400 NEVER chmod 777, if something requires write access use 766&lt;br /&gt;Variable (mod_env) Magic&lt;br /&gt;Set the Timezone of the server:&lt;br /&gt;SetEnv TZ America/Indianapolis&lt;br /&gt;Set the Server Administrator Email:&lt;br /&gt;SetEnv SERVER_ADMIN webmaste@htaccesselite.com&lt;br /&gt;Turn off the ServerSignature&lt;br /&gt;ServerSignature Off&lt;br /&gt;Add a "en-US" language tag and "text/html; UTF-8" headers without meta tags&lt;br /&gt;&lt;br /&gt;Article: Setting Charset in htaccess&lt;br /&gt;&lt;br /&gt;Article: Using FilesMatch and Files in htaccess&lt;br /&gt;AddDefaultCharset UTF-8&lt;br /&gt;# Or AddType 'text/html; charset=UTF-8' html&lt;br /&gt;DefaultLanguage en-US&lt;br /&gt;Using the Files Directive&lt;br /&gt;&lt;files&gt;&lt;br /&gt;   AddDefaultCharset UTF-8&lt;br /&gt;   DefaultLanguage en-US&lt;br /&gt;&lt;/files&gt;&lt;br /&gt;Using the FilesMatch Directive (preferred)&lt;br /&gt;&lt;filesmatch&gt;&lt;br /&gt;   AddDefaultCharset UTF-8&lt;br /&gt;   DefaultLanguage en-US&lt;br /&gt;&lt;/filesmatch&gt;&lt;br /&gt;Use a custom php.ini with mod_php or php as a cgi&lt;br /&gt;&lt;br /&gt;Article: Custom PHP.ini tips and tricks&lt;br /&gt;&lt;br /&gt;    When php run as Apache Module (mod_php) in root .htaccess SetEnv PHPRC /location/todir/containing/phpinifile When php run as CGI Place your php.ini file in the dir of your cgi’d php, in this case /cgi-bin/ htaccess might look something like this AddHandler php-cgi .php .htm Action php-cgi /cgi-bin/php5.cgi When cgi’d php is run with wrapper (for FastCGI) You will have a shell wrapper script something like this: #!/bin/sh export PHP_FCGI_CHILDREN=3 exec /user3/x.com/htdocs/cgi-bin/php5.cgi Change To #!/bin/sh export PHP_FCGI_CHILDREN=3 exec /x.com/cgi-bin/php.cgi -c /abs/path/to/php.ini&lt;br /&gt;&lt;br /&gt;Securing directories: Remove the ability to execute scripts&lt;br /&gt;&lt;br /&gt;Heres a couple different ways I do it&lt;br /&gt;AddHandler cgi-script .php .pl .py .jsp .asp .htm .shtml .sh .cgi&lt;br /&gt;Options -ExecCGI&lt;br /&gt;&lt;br /&gt;This is cool, you are basically categorizing all those files that end in those extensions so that they fall under the jurisdiction of the -ExecCGI command, which also means -FollowSymLinks (and the opposite is also true, +ExecCGI also turns on +FollowSymLinks)&lt;br /&gt;Only allow GET and PUT request methods to your server.&lt;br /&gt;Options -ExecCGI -Indexes -All +FollowSymLinks&lt;br /&gt;RewriteEngine On&lt;br /&gt;RewriteBase /&lt;br /&gt;RewriteCond %{REQUEST_METHOD} !^(GET|PUT)&lt;br /&gt;RewriteRule .* - [F]&lt;br /&gt;Processing All gif files to be processed through a cgi script&lt;br /&gt;Action image/gif /cgi-bin/filter.cgi&lt;br /&gt;Process request/file depending on the request method&lt;br /&gt;Script PUT /cgi-bin/upload.cgi&lt;br /&gt;Force Files to download, not be displayed in browser&lt;br /&gt;AddType application/octet-stream .avi&lt;br /&gt;AddType application/octet-stream .mpg&lt;br /&gt;&lt;br /&gt;Then in your HTML you could just link directly to the file..&lt;br /&gt;&lt;a href="http://www.askapache.com/movies/mov1.avi"&gt;Download Movie1&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;And then you will get a pop-up box asking whether you want to save the file or open it.&lt;br /&gt;Show the source code of dynamic files&lt;br /&gt;&lt;br /&gt;If you'd rather have .pl, .py, or .cgi files displayed in the browser as source rather than be executed as scripts, simply create a .htaccess file in the relevant directory with the following:&lt;br /&gt;RemoveHandler cgi-script .pl .py .cgi&lt;br /&gt;Dramatically Speed up your site by implementing Caching!&lt;br /&gt;&lt;br /&gt;Article: Speed Up Sites with htaccess Caching&lt;br /&gt;# MONTH&lt;br /&gt;&lt;filesmatch&gt;&lt;br /&gt;   Header set Cache-Control "max-age=2592000"&lt;br /&gt;&lt;/filesmatch&gt;&lt;br /&gt;&lt;br /&gt;# WEEK&lt;br /&gt;&lt;filesmatch&gt;&lt;br /&gt;   Header set Cache-Control "max-age=604800"&lt;br /&gt;&lt;/filesmatch&gt;&lt;br /&gt;&lt;br /&gt;# DAY&lt;br /&gt;&lt;filesmatch&gt;&lt;br /&gt;   Header set Cache-Control "max-age=43200"&lt;br /&gt;&lt;/filesmatch&gt;&lt;br /&gt;Prevent Files image/file hotlinking and bandwidth stealing&lt;br /&gt;Options +FollowSymLinks&lt;br /&gt;RewriteEngine On&lt;br /&gt;RewriteBase /&lt;br /&gt;RewriteCond %{HTTP_REFERER} !^$&lt;br /&gt;RewriteCond %{HTTP_REFERER} !^http://(www\.)?askapache.com/.*$ [NC]&lt;br /&gt;RewriteRule \.(gif|jpg|swf|flv|png)$ http://www.askapache.com/feed.gif [R=302,L]&lt;br /&gt;ErrorDocuments&lt;br /&gt;&lt;br /&gt;Article: Additional ErrorDocument Info and Examples&lt;br /&gt;ErrorDocument 404 /favicon.ico&lt;br /&gt;ErrorDocument 403 https://secure.htaccesselite.com&lt;br /&gt;ErrorDocument 404 /cgi-bin/error.php&lt;br /&gt;ErrorDocument 400 /cgi-bin/error.php&lt;br /&gt;ErrorDocument 401 /cgi-bin/error.php&lt;br /&gt;ErrorDocument 403 /cgi-bin/error.php&lt;br /&gt;ErrorDocument 405 /cgi-bin/error.php&lt;br /&gt;ErrorDocument 406 /cgi-bin/error.php&lt;br /&gt;ErrorDocument 409 /cgi-bin/error.php&lt;br /&gt;ErrorDocument 413 /cgi-bin/error.php&lt;br /&gt;ErrorDocument 414 /cgi-bin/error.php&lt;br /&gt;ErrorDocument 500 /cgi-bin/error.php&lt;br /&gt;ErrorDocument 501 /cgi-bin/error.php&lt;br /&gt;&lt;br /&gt;Note: You can also do an external link, but don't do an external link to your site or you will cause a loop that will hurt your SEO.&lt;br /&gt;Authentication Magic&lt;br /&gt;Require password for 1 file:&lt;br /&gt;&lt;files&gt;&lt;br /&gt;   AuthName "Prompt"&lt;br /&gt;   AuthType Basic&lt;br /&gt;   AuthUserFile /home/askapache.com/.htpasswd&lt;br /&gt;   Require valid-user&lt;br /&gt;&lt;/files&gt;&lt;br /&gt;Protect multiple files:&lt;br /&gt;&lt;filesmatch&gt;&lt;br /&gt;   AuthName "Development"&lt;br /&gt;   AuthUserFile /.htpasswd&lt;br /&gt;   AuthType basic&lt;br /&gt;   Require valid-user&lt;br /&gt;&lt;/filesmatch&gt;&lt;br /&gt;Example uses of the Allow Directive:&lt;br /&gt;# A (partial) domain-name&lt;br /&gt;Allow from 10.1.0.0/255.255.0.0&lt;br /&gt;&lt;br /&gt;# Full IP address&lt;br /&gt;Allow from 10.1.2.3&lt;br /&gt;&lt;br /&gt;# More than 1 full IP address&lt;br /&gt;Allow from 192.168.1.104 192.168.1.205&lt;br /&gt;&lt;br /&gt;# Partial IP addresses&lt;br /&gt;# first 1 to 3 bytes of IP, for subnet restriction.&lt;br /&gt;Allow from 10.1&lt;br /&gt;Allow from 10 172.20 192.168.2&lt;br /&gt;&lt;br /&gt;# network/netmask pair&lt;br /&gt;Allow from 10.1.0.0/255.255.0.0&lt;br /&gt;&lt;br /&gt;# network/nnn CIDR specification&lt;br /&gt;Allow from 10.1.0.0/16&lt;br /&gt;&lt;br /&gt;# IPv6 addresses and subnets&lt;br /&gt;Allow from 2001:db8::a00:20ff:fea7:ccea&lt;br /&gt;Allow from 2001:db8::a00:20ff:fea7:ccea/10&lt;br /&gt;Using visitor dependent environment variables:&lt;br /&gt;&lt;br /&gt;Article: Additional SetEnvIf examples&lt;br /&gt;SetEnvIf User-Agent ^KnockKnock/2\.0 let_me_in&lt;br /&gt;Order Deny,Allow&lt;br /&gt;Deny from all&lt;br /&gt;Allow from env=let_me_in&lt;br /&gt;Allow from apache.org but deny from foo.apache.org&lt;br /&gt;Order Allow,Deny&lt;br /&gt;Allow from apache.org&lt;br /&gt;Deny from foo.apache.org&lt;br /&gt;Allow from IP address with no password prompt, and also allow from non-Ip address with password prompt:&lt;br /&gt;AuthUserFile /home/www/site1-passwd&lt;br /&gt;AuthType Basic&lt;br /&gt;AuthName MySite&lt;br /&gt;Require valid-user&lt;br /&gt;Allow from 172.17.10&lt;br /&gt;Satisfy Any&lt;br /&gt;block access to files during certain hours of the day&lt;br /&gt;Options +FollowSymLinks&lt;br /&gt;RewriteEngine On&lt;br /&gt;RewriteBase /&lt;br /&gt;# If the hour is 16 (4 PM) Then deny all access&lt;br /&gt;RewriteCond %{TIME_HOUR} ^16$&lt;br /&gt;RewriteRule ^.*$ - [F,L]&lt;br /&gt;A good default example .htaccess file&lt;br /&gt;&lt;br /&gt;I use this when I start a new site, and uncomment or delete parts of the file depending on the sites needs&lt;br /&gt;# DEFAULT SETTINGS&lt;br /&gt;##############################################&lt;br /&gt;Options +ExecCGI -Indexes&lt;br /&gt;DirectoryIndex index.php index.html index.htm&lt;br /&gt;&lt;br /&gt;### DEFAULTS ###&lt;br /&gt;ServerSignature Off&lt;br /&gt;AddType video/x-flv .flv&lt;br /&gt;AddType application/x-shockwave-flash .swf&lt;br /&gt;AddType image/x-icon .ico&lt;br /&gt;AddDefaultCharset UTF-8&lt;br /&gt;DefaultLanguage en-US&lt;br /&gt;SetEnv TZ America/Indianapolis&lt;br /&gt;SetEnv SERVER_ADMIN webmaster@askapache.com&lt;br /&gt;&lt;br /&gt;### FAST-CGI ###&lt;br /&gt;AddHandler fastcgi-script fcgi&lt;br /&gt;AddHandler php-cgi .php&lt;br /&gt;Action php-cgi /cgi-bin/php5-wrapper.fcgi&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;# HEADERS and CACHING&lt;br /&gt;##############################################&lt;br /&gt;#### CACHING ####&lt;br /&gt;# YEAR&lt;br /&gt;&lt;filesmatch&gt;&lt;br /&gt;   Header set Cache-Control "max-age=2592000"&lt;br /&gt;&lt;/filesmatch&gt;&lt;br /&gt;# WEEK&lt;br /&gt;&lt;filesmatch&gt;&lt;br /&gt;   Header set Cache-Control "max-age=604800"&lt;br /&gt;&lt;/filesmatch&gt;&lt;br /&gt;# 10 minutes&lt;br /&gt;&lt;filesmatch&gt;&lt;br /&gt;   Header set Cache-Control "max-age=600"&lt;br /&gt;&lt;/filesmatch&gt;&lt;br /&gt;# DONT CACHE&lt;br /&gt;&lt;filesmatch&gt;&lt;br /&gt;   Header unset Cache-Control&lt;br /&gt;&lt;/filesmatch&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;# REWRITES AND REDIRECTS&lt;br /&gt;##############################################&lt;br /&gt;### SEO REDIRECTS ###&lt;br /&gt;Redirect 301 /2006/uncategorized/htaccesselitecom-aboutus.html http://www.^^SITE^^.^^TLD^^&lt;br /&gt;&lt;br /&gt;### REWRITES ###&lt;br /&gt;RewriteEngine On&lt;br /&gt;RewriteBase /&lt;br /&gt;&lt;br /&gt;### WORDPRESS ###&lt;br /&gt;# BEGIN WordPress&lt;br /&gt;&lt;ifmodule&gt;&lt;br /&gt;RewriteEngine On&lt;br /&gt;RewriteBase /&lt;br /&gt;RewriteCond %{REQUEST_FILENAME} !-f&lt;br /&gt;RewriteCond %{REQUEST_FILENAME} !-d&lt;br /&gt;RewriteRule . /index.php [L]&lt;br /&gt;&lt;/ifmodule&gt;&lt;br /&gt;&lt;br /&gt;# END WordPress&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;# AUTHENTICATION&lt;br /&gt;##############################################&lt;br /&gt;AuthName "askapache.com"&lt;br /&gt;Require valid-user&lt;br /&gt;AuthUserFile /askapache/.htpasswd&lt;br /&gt;AuthType basic&lt;br /&gt;Ultimate htaccess Article&lt;br /&gt;10 comments on this article. Log in to add your comment |&lt;br /&gt;Awesome .htaccess resource!&lt;br /&gt;&lt;br /&gt;Submitted by mydesignbuddy on February 8, 2007 - 15:58.&lt;br /&gt;&lt;br /&gt;I've been looking a long time for a simple cheat sheet on most of these useful functions in apache. Even cooler, you have other features that I never knew about.&lt;br /&gt;&lt;br /&gt;Thanks John,&lt;br /&gt;&lt;br /&gt;login or register to post comments&lt;br /&gt;Yeah its pretty awesome&lt;br /&gt;&lt;br /&gt;Submitted by apachehtaccess on February 9, 2007 - 05:04.&lt;br /&gt;&lt;br /&gt;Its being improved and getting better and better all the time.. check it out at AskApache Ultimate htaccess&lt;br /&gt;&lt;br /&gt;login or register to post comments&lt;br /&gt;So what would be the best&lt;br /&gt;&lt;br /&gt;Submitted by cianuro on February 17, 2007 - 00:44.&lt;br /&gt;So what would be the best method to redirect individual pages sitewide. For example, 301 redirect&lt;br /&gt;&lt;br /&gt;domain1.com/productname.html to domain2.com/productname.html&lt;br /&gt;domain1.com/productname2.html to domain2.com/productname.html&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Like if one was to redirect a whole site to a completely new domain using the same URL and directory structure?&lt;br /&gt;&lt;br /&gt;login or register to post comments&lt;br /&gt;SOMEONE KNOW HOW TO ADD NEW FIELD PLZ&lt;br /&gt;&lt;br /&gt;Submitted by buttercup on February 17, 2007 - 00:56.&lt;br /&gt;I want to add new field in the useredit.php&lt;br /&gt;the register.php is good and dont have to add field but i want&lt;br /&gt;when the user is logged in he go to edit account and add his infos&lt;br /&gt;ex: location, name, b-day....&lt;br /&gt;SOMEONE CNA HELP ME PLZ THANK YOU&lt;br /&gt;&lt;br /&gt;login or register to post comments&lt;br /&gt;For questions about mod_rewrite and htaccess&lt;br /&gt;&lt;br /&gt;Submitted by apachehtaccess on February 23, 2007 - 09:51.&lt;br /&gt;For questions about mod_rewrite and htaccess check out the htaccessElite htaccess Forum You will get your questions answered there.&lt;br /&gt;&lt;br /&gt;login or register to post comments&lt;br /&gt;Thanks!! Excatly what I was looking for&lt;br /&gt;&lt;br /&gt;Submitted by AxelF on March 7, 2007 - 13:31.&lt;br /&gt;Very nice collection of examples - I had some serious trouble configuration restricted areas via .htaccess for my hobby-projects. Regards, Axel&lt;br /&gt;&lt;br /&gt;login or register to post comments&lt;br /&gt;Double Login&lt;br /&gt;&lt;br /&gt;Submitted by Spirit77 on March 13, 2007 - 12:42.&lt;br /&gt;I have also try it, and it works perfectly. Every request from mydomain.com is redirected to www.mydomain.com and the problems with the double login on my projekt are removed. Thanks&lt;br /&gt;&lt;br /&gt;login or register to post comments&lt;br /&gt;New version&lt;br /&gt;&lt;br /&gt;Submitted by apachehtaccess on March 30, 2007 - 21:34.&lt;br /&gt;There is more info to be found at Apache htaccess ultimate article&lt;br /&gt;&lt;br /&gt;login or register to post comments&lt;br /&gt;Very Extensive&lt;br /&gt;&lt;br /&gt;Submitted by Tjeerd Kramer on May 8, 2007 - 10:05.&lt;br /&gt;Being a webdeveloper / SEO engineer, .htaccess is one of the most powerfull tools at hand. I've bookmarked this extensive article for future reference, thanks a bunch!&lt;br /&gt;&lt;br /&gt;login or register to post comments&lt;br /&gt;ldap issues&lt;br /&gt;&lt;br /&gt;Submitted by 5mi11er on May 24, 2007 - 20:06.&lt;br /&gt;I cam across this page in search of an answer to the issue I discovered on our sites. I'd found my /var/log/messages being filled with lots of messages stating:&lt;br /&gt;    httpd(pam_unix)[24404]: authentication failure; logname= uid=48 euid=48 tty= ruser= rhost= user=someuser&lt;br /&gt;even though access was being granted. We primarily use PAM enabled LDAP for authentication, so, the hints about making sure apache could read the /etc/shadow file were backward for me; the authentication info wouldn't be found in /etc/shadow.&lt;br /&gt;&lt;br /&gt;But, according to the /etc/pam.d/httpd config, it was simply pointing to system_auth, and thus unix authentication was also being tried on every web page access, and since apache didn't have access to /etc/shadow, that attempt would always fail.&lt;br /&gt;&lt;br /&gt;So, I created a /etc/pam.d/system_auth_ldap file with the following:&lt;br /&gt;#%PAM-1.0&lt;br /&gt;auth required /lib/security/pam_env.so&lt;br /&gt;#auth sufficient /lib/security/pam_unix.so likeauth nullok&lt;br /&gt;auth sufficient /lib/security/pam_ldap.so&lt;br /&gt;auth required /lib/security/pam_deny.so&lt;br /&gt;&lt;br /&gt;#account required /lib/security/pam_unix.so&lt;br /&gt;#account [default=bad success=ok user_unknown=ignore authinfo_unavail=ignore system_err=ignore service_err=ignore] /lib/security/pam_ldap.so&lt;br /&gt;account required /lib/security/pam_ldap.so&lt;br /&gt;&lt;br /&gt;password required /lib/security/pam_cracklib.so retry=3 type=&lt;br /&gt;#password sufficient /lib/security/pam_unix.so nullok use_authtok md5 shadow&lt;br /&gt;password sufficient /lib/security/pam_ldap.so use_authtok&lt;br /&gt;password required /lib/security/pam_deny.so&lt;br /&gt;&lt;br /&gt;session required /lib/security/pam_limits.so&lt;br /&gt;#session required /lib/security/pam_unix.so&lt;br /&gt;session optional /lib/security/pam_ldap.so&lt;br /&gt;And modified the /etc/pam.d/httpd config file to this:&lt;br /&gt;#%PAM-1.0&lt;br /&gt;auth required /lib/security/pam_stack.so service=system-auth-ldap&lt;br /&gt;account required /lib/security/pam_stack.so service=system-auth-ldap&lt;br /&gt;account required /lib/security/pam_permit.so service=system-auth-ldap&lt;br /&gt;I hope this helps someone else out there.&lt;div class="blogger-post-footer"&gt;Taken From : Speedybiz Blog Network&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1343133296744135180-3923669811144041895?l=speedybiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedybiz.blogspot.com/feeds/3923669811144041895/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1343133296744135180&amp;postID=3923669811144041895' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1343133296744135180/posts/default/3923669811144041895'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1343133296744135180/posts/default/3923669811144041895'/><link rel='alternate' type='text/html' href='http://speedybiz.blogspot.com/2008/07/ultimate-htaccess-examples.html' title='Ultimate htaccess Examples'/><author><name>speedybiz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp1.blogger.com/_RJhWWe1VrV8/SFFGoy0rStI/AAAAAAAAAAU/aOr375h3bXI/S220/speedybiz_superhero.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1343133296744135180.post-246785715720300173</id><published>2008-07-04T06:34:00.001+07:00</published><updated>2012-01-14T07:21:00.618+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SEO'/><title type='text'>.htaccess File and mod_rewrite examples</title><content type='html'>An attempt to create a default skeleton .htaccess file with the very best apache htaccess examples… Updated semi-frequently based on detailed info from the Apache htaccess tutorial.&lt;br /&gt;&lt;br /&gt;If you see any room for improvement, or if you can add something than go ahead and comment and I will definately give it a look for possible inclusion.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;=============================================================================#&lt;br /&gt;          MAIN SETTINGS AND OPTIONS&lt;br /&gt;=============================================================================#&lt;br /&gt; Options: ALL,FollowSymLinks,Includes,IncludesNOEXEC,SymLinksIfOwnerMatch&lt;br /&gt;##########&lt;br /&gt;&lt;br /&gt;## MAIN DEFAULTS ###&lt;br /&gt;Options +ExecCGI -Indexes&lt;br /&gt;DirectoryIndex index.html index.htm index.php&lt;br /&gt;DefaultLanguage en-US&lt;br /&gt;AddDefaultCharset UTF-8&lt;br /&gt;ServerSignature Off&lt;br /&gt;&lt;br /&gt;## ENVIRONMENT VARIABLES ###&lt;br /&gt;SetEnv PHPRC /webroot/includes&lt;br /&gt;SetEnv TZ America/Indianapolis&lt;br /&gt;SetEnv SERVER_ADMIN webmaster@domain.tld&lt;br /&gt;&lt;br /&gt;## MIME TYPES ###&lt;br /&gt;AddType video/x-flv .flv&lt;br /&gt;AddType application/x-shockwave-flash .swf&lt;br /&gt;AddType image/x-icon .ico&lt;br /&gt;&lt;br /&gt;## FORCE FILE TO DOWNLOAD INSTEAD OF APPEAR IN BROWSER ###&lt;br /&gt;-&gt; http://www.htaccesselite.com/addtype-addhandler-action-vf6.html&lt;br /&gt;AddType application/octet-stream .mov .mp3 .zip&lt;br /&gt;&lt;br /&gt;## ERRORDOCUMENTS ###&lt;br /&gt;&lt;br /&gt;-&gt; http://askapache.com/htaccess/apache-status-code-headers-errordocument.html&lt;br /&gt;&lt;br /&gt;======== 1xx&lt;br /&gt;ErrorDocument 100 /error-100/&lt;br /&gt;ErrorDocument 101 /error-101/&lt;br /&gt;ErrorDocument 102 /error-102/&lt;br /&gt;======== 2xx&lt;br /&gt;ErrorDocument 200 /error-200/&lt;br /&gt;ErrorDocument 201 /error-201/&lt;br /&gt;ErrorDocument 202 /error-202/&lt;br /&gt;ErrorDocument 203 /error-203/&lt;br /&gt;ErrorDocument 204 /error-204/&lt;br /&gt;ErrorDocument 205 /error-205/&lt;br /&gt;ErrorDocument 206 /error-206/&lt;br /&gt;ErrorDocument 207 /error-207/&lt;br /&gt;======== 4xx&lt;br /&gt;ErrorDocument 400 /error-400/&lt;br /&gt;ErrorDocument 401 /error-401/&lt;br /&gt;ErrorDocument 402 /error-402/&lt;br /&gt;ErrorDocument 403 /error-403/&lt;br /&gt;ErrorDocument 404 /error-404/&lt;br /&gt;ErrorDocument 405 /error-405/&lt;br /&gt;ErrorDocument 406 /error-406/&lt;br /&gt;ErrorDocument 407 /error-407/&lt;br /&gt;ErrorDocument 408 /error-408/&lt;br /&gt;ErrorDocument 409 /error-409/&lt;br /&gt;ErrorDocument 410 /error-410/&lt;br /&gt;ErrorDocument 411 /error-411/&lt;br /&gt;ErrorDocument 412 /error-412/&lt;br /&gt;ErrorDocument 413 /error-413/&lt;br /&gt;ErrorDocument 414 /error-414/&lt;br /&gt;ErrorDocument 415 /error-415/&lt;br /&gt;ErrorDocument 416 /error-416/&lt;br /&gt;ErrorDocument 417 /error-417/&lt;br /&gt;ErrorDocument 418 /error-418/&lt;br /&gt;ErrorDocument 419 /error-419/&lt;br /&gt;ErrorDocument 420 /error-420/&lt;br /&gt;ErrorDocument 421 /error-421/&lt;br /&gt;ErrorDocument 422 /error-422/&lt;br /&gt;ErrorDocument 423 /error-423/&lt;br /&gt;ErrorDocument 424 /error-424/&lt;br /&gt;ErrorDocument 425 /error-425/&lt;br /&gt;ErrorDocument 426 /error-426/&lt;br /&gt;======== 5xx&lt;br /&gt;ErrorDocument 500 /error-500/&lt;br /&gt;ErrorDocument 501 /error-501/&lt;br /&gt;ErrorDocument 502 /error-502/&lt;br /&gt;ErrorDocument 503 /error-503/&lt;br /&gt;ErrorDocument 504 /error-504/&lt;br /&gt;ErrorDocument 505 /error-505/&lt;br /&gt;ErrorDocument 506 /error-506/&lt;br /&gt;ErrorDocument 507 /error-507/&lt;br /&gt;ErrorDocument 508 /error-508/&lt;br /&gt;ErrorDocument 509 /error-509/&lt;br /&gt;ErrorDocument 510 /error-510/&lt;br /&gt;&lt;br /&gt;AddLanguage aa .aa # Afar&lt;br /&gt;AddLanguage ab .ab # Abkhazian&lt;br /&gt;AddLanguage af .af # Afrikaans&lt;br /&gt;AddLanguage am .am # Amharic&lt;br /&gt;AddLanguage ar .ar # Arabic&lt;br /&gt;AddLanguage as .as # Assamese&lt;br /&gt;AddLanguage ay .ay # Aymara&lt;br /&gt;AddLanguage az .az # Azerbaijani&lt;br /&gt;AddLanguage ba .ba # Bashkir&lt;br /&gt;AddLanguage be .be # Byelorussian&lt;br /&gt;AddLanguage bg .bg # Bulgarian&lt;br /&gt;AddLanguage bh .bh # Bihari&lt;br /&gt;AddLanguage bi .bi # Bislama&lt;br /&gt;AddLanguage bn .bn # Bengali; Bangla&lt;br /&gt;AddLanguage bo .bo # Tibetan&lt;br /&gt;AddLanguage br .br # Breton&lt;br /&gt;AddLanguage ca .ca # Catalan&lt;br /&gt;AddLanguage co .co # Corsican&lt;br /&gt;AddLanguage cs .cs # Czech&lt;br /&gt;AddLanguage cy .cy # Welsh&lt;br /&gt;AddLanguage da .da # Danish&lt;br /&gt;AddLanguage de .de # German&lt;br /&gt;AddLanguage dz .dz # Bhutani&lt;br /&gt;AddLanguage el .el # Greek&lt;br /&gt;AddLanguage en .en # English&lt;br /&gt;AddLanguage eo .eo # Esperanto&lt;br /&gt;AddLanguage es .es # Spanish&lt;br /&gt;AddLanguage et .et # Estonian&lt;br /&gt;AddLanguage eu .eu # Basque&lt;br /&gt;AddLanguage fa .fa # Persian&lt;br /&gt;AddLanguage fi .fi # Finnish&lt;br /&gt;AddLanguage fj .fj # Fiji&lt;br /&gt;AddLanguage fo .fo # Faeroese&lt;br /&gt;AddLanguage fr .fr # French&lt;br /&gt;AddLanguage fy .fy # Frisian&lt;br /&gt;AddLanguage ga .ga # Irish&lt;br /&gt;AddLanguage gd .gd # Scots Gaelic&lt;br /&gt;AddLanguage gl .gl # Galician&lt;br /&gt;AddLanguage gn .gn # Guamni&lt;br /&gt;AddLanguage gu .gu # Gujarati&lt;br /&gt;AddLanguage ha .ha # Hausa&lt;br /&gt;AddLanguage he .he # Hebrew&lt;br /&gt;AddLanguage hi .hi # Hindi&lt;br /&gt;AddLanguage hr .hr # Croatian&lt;br /&gt;AddLanguage hu .hu # Hungarian&lt;br /&gt;AddLanguage hy .hy # Armenian&lt;br /&gt;AddLanguage ia .ia # Interlingua&lt;br /&gt;AddLanguage id .id # Indonesian&lt;br /&gt;AddLanguage ie .ie # lnteriingue&lt;br /&gt;AddLanguage ik .ik # Knupiak&lt;br /&gt;AddLanguage is .is # Icelandic&lt;br /&gt;AddLanguage it .it # Italian&lt;br /&gt;AddLanguage iu .iu # Inuktitut (Eskimo)&lt;br /&gt;AddLanguage ja .ja # Japanese&lt;br /&gt;AddLanguage jw .jw # Javanese&lt;br /&gt;AddLanguage ka .ka # Georgian&lt;br /&gt;AddLanguage kk .kk # Kazakh&lt;br /&gt;AddLanguage kl .kl # Greaenlandic&lt;br /&gt;AddLanguage km .km # Cambodian&lt;br /&gt;AddLanguage kn .kn # Kannada&lt;br /&gt;AddLanguage ko .ko # Korean&lt;br /&gt;AddLanguage ks .ks # Kashmiri&lt;br /&gt;AddLanguage ku .ku # Kurdish&lt;br /&gt;AddLanguage ky .ky # Kirghiz&lt;br /&gt;AddLanguage la .la # Latin&lt;br /&gt;AddLanguage ln .ln # Lingala&lt;br /&gt;AddLanguage lo .lo # Laothian&lt;br /&gt;AddLanguage lt .lt # Lithuainnian&lt;br /&gt;AddLanguage lv .lv # Latvian, Lettish&lt;br /&gt;AddLanguage mg .mg # Malagasy&lt;br /&gt;AddLanguage mi .mi # Maori&lt;br /&gt;AddLanguage mk .mk # Macedonian&lt;br /&gt;AddLanguage ml .ml # Malayalam&lt;br /&gt;AddLanguage mn .mn # Mongolian&lt;br /&gt;AddLanguage mo .mo # Moldavian&lt;br /&gt;AddLanguage mr .mr # Marathi&lt;br /&gt;AddLanguage ms .ms # Malay&lt;br /&gt;AddLanguage mt .mt # Maltese&lt;br /&gt;AddLanguage my .my # Burmese&lt;br /&gt;AddLanguage na .na # Nauru&lt;br /&gt;AddLanguage ne .ne # Nepali&lt;br /&gt;AddLanguage nl .nl # Dutch&lt;br /&gt;AddLanguage no .no # Norwegian&lt;br /&gt;AddLanguage oc .oc # Occitan&lt;br /&gt;AddLanguage om .om # (Afan) Oromo&lt;br /&gt;AddLanguage or .or # Oriya&lt;br /&gt;AddLanguage pa .pa # Punjabi&lt;br /&gt;AddLanguage pl .po # Polish (use .po instead .pl to avoid problems with perl files)&lt;br /&gt;AddLanguage ps .ps # Pashto, Pushto&lt;br /&gt;AddLanguage pt .pt # Portuguese&lt;br /&gt;AddLanguage qu .qu # Ouechua&lt;br /&gt;AddLanguage rm .rm # Rhaeto-Romance&lt;br /&gt;AddLanguage rn .rn # Kirundi&lt;br /&gt;AddLanguage ro .ro # Romanian&lt;br /&gt;AddLanguage ru .ru # Russian&lt;br /&gt;AddLanguage rw .rw # Kinya, Rwanda&lt;br /&gt;AddLanguage sa .sa # Sanskrit&lt;br /&gt;AddLanguage sd .sd # Sindhi&lt;br /&gt;AddLanguage sg .sg # Sangro&lt;br /&gt;AddLanguage sh .sh # Serbo-Croatian&lt;br /&gt;AddLanguage si .si # Singhalese&lt;br /&gt;AddLanguage sk .sk # Slovak&lt;br /&gt;AddLanguage sl .sl # Slovenian&lt;br /&gt;AddLanguage sm .sm # Samoan&lt;br /&gt;AddLanguage sn .sn # Shona&lt;br /&gt;AddLanguage so .so # Somali&lt;br /&gt;AddLanguage sq .sq # Albanian&lt;br /&gt;AddLanguage sr .sr # Serbian&lt;br /&gt;AddLanguage ss .ss # Siswati&lt;br /&gt;AddLanguage st .st # Sesotho&lt;br /&gt;AddLanguage su .su # Sundanese&lt;br /&gt;AddLanguage sv .sv # Swedish&lt;br /&gt;AddLanguage sw .sw # Swahili&lt;br /&gt;AddLanguage ta .ta # Tamil&lt;br /&gt;AddLanguage te .te # Tegulu&lt;br /&gt;AddLanguage tg .tg # Tajik&lt;br /&gt;AddLanguage th .th # Thai&lt;br /&gt;AddLanguage ti .ti # Tigrinya&lt;br /&gt;AddLanguage tk .tk # Turkmen&lt;br /&gt;AddLanguage tl .tl # Tagalog&lt;br /&gt;AddLanguage tn .tn # Setswana&lt;br /&gt;AddLanguage to .to # Tonga&lt;br /&gt;AddLanguage tr .tr # Turkish&lt;br /&gt;AddLanguage ts .ts # Tsonga&lt;br /&gt;AddLanguage tt .tt # Tatar&lt;br /&gt;AddLanguage tw .tw # Twi&lt;br /&gt;AddLanguage ug .ug # Uigur&lt;br /&gt;AddLanguage uk .uk # Ukrainian&lt;br /&gt;AddLanguage ur .ur # Urdu&lt;br /&gt;AddLanguage uz .uz # Uzbek&lt;br /&gt;AddLanguage vi .vi # Vietnamese&lt;br /&gt;AddLanguage vo .vo # Volapuek&lt;br /&gt;AddLanguage wo .wo # Wolof&lt;br /&gt;AddLanguage xh .xh # Xhosa&lt;br /&gt;AddLanguage yi .yi # Yiddish&lt;br /&gt;AddLanguage yo .yo # Yoruba&lt;br /&gt;AddLanguage za .za # Zhuang&lt;br /&gt;AddLanguage zh .zh # Chinese&lt;br /&gt;AddLanguage zu .zu # Zulu&lt;br /&gt;&lt;br /&gt;=============================================================================#&lt;br /&gt;          SCRIPTING, ACTION, ADDHANDLER&lt;br /&gt;=============================================================================#&lt;br /&gt; Handlers be builtin, included in a module, or added with Action directive&lt;br /&gt; default-handler: default, handles static content (core)&lt;br /&gt;      send-as-is: Send file with HTTP headers (mod_asis)&lt;br /&gt;      cgi-script: treat file as CGI script (mod_cgi)&lt;br /&gt;       imap-file: Parse as an imagemap rule file (mod_imap)&lt;br /&gt;     server-info: Get server config info (mod_info)&lt;br /&gt;   server-status: Get server status report (mod_status)&lt;br /&gt;        type-map: type map file for content negotiation (mod_negotiation)&lt;br /&gt;  fastcgi-script: treat file as fastcgi script (mod_fastcgi)&lt;br /&gt;##########&lt;br /&gt;&lt;br /&gt;-&gt; http://www.askapache.com/php/custom-phpini-tips-and-tricks.html&lt;br /&gt;&lt;br /&gt;## PARSE AS CGI ###&lt;br /&gt;AddHandler cgi-script .cgi .pl .spl&lt;br /&gt;&lt;br /&gt;## RUN PHP AS APACHE MODULE ###&lt;br /&gt;AddHandler application/x-httpd-php .php .htm&lt;br /&gt;&lt;br /&gt;## RUN PHP AS CGI ###&lt;br /&gt;AddHandler php-cgi .php .htm&lt;br /&gt;&lt;br /&gt;## CGI PHP WRAPPER FOR CUSTOM PHP.INI ###&lt;br /&gt;AddHandler phpini-cgi .php .htm&lt;br /&gt;Action phpini-cgi /cgi-bin/php5-custom-ini.cgi&lt;br /&gt;&lt;br /&gt;## FAST-CGI SETUP WITH PHP-CGI WRAPPER FOR CUSTOM PHP.INI ###&lt;br /&gt;AddHandler fastcgi-script .fcgi&lt;br /&gt;AddHandler php-cgi .php .htm&lt;br /&gt;Action php-cgi /cgi-bin/php5-wrapper.fcgi&lt;br /&gt;&lt;br /&gt;## CUSTOM PHP CGI BINARY SETUP ###&lt;br /&gt;AddHandler php-cgi .php .htm&lt;br /&gt;Action php-cgi /cgi-bin/php.cgi&lt;br /&gt;&lt;br /&gt;## PROCESS SPECIFIC FILETYPES WITH CGI-SCRIPT ###&lt;br /&gt;Action image/gif /cgi-bin/img-create.cgi&lt;br /&gt;&lt;br /&gt;## CREATE CUSTOM HANDLER FOR SPECIFIC FILE EXTENSIONS ###&lt;br /&gt;AddHandler custom-processor .ssp&lt;br /&gt;Action custom-processor /cgi-bin/myprocessor.cgi&lt;br /&gt;&lt;br /&gt;=============================================================================#&lt;br /&gt;          HEADERS, CACHING AND OPTIMIZATION&lt;br /&gt;=============================================================================#&lt;br /&gt;-&gt; http://www.htaccesselite.com/cache-control-http-headers-vt65.html&lt;br /&gt;      300   5 M&lt;br /&gt;     2700  45 M&lt;br /&gt;     3600   1 H&lt;br /&gt;    54000  15 H&lt;br /&gt;    86400   1 D&lt;br /&gt;   518400   6 D&lt;br /&gt;   604800   1 W&lt;br /&gt;  1814400   3 W&lt;br /&gt;  2419200   1 M&lt;br /&gt; 26611200  11 M&lt;br /&gt; 29030400   1 Y (never expire)&lt;br /&gt;##########&lt;br /&gt;&lt;br /&gt;### HEADER CACHING ####&lt;br /&gt;-&gt; http://www.askapache.com/htaccess/speed-up-sites-with-htaccess-caching.html&lt;br /&gt;&lt;filesmatch&gt;&lt;br /&gt;   Header set Cache-Control "max-age=2592000"&lt;br /&gt;&lt;/filesmatch&gt;&lt;br /&gt;&lt;filesmatch&gt;&lt;br /&gt;   Header set Cache-Control "max-age=604800"&lt;br /&gt;&lt;/filesmatch&gt;&lt;br /&gt;&lt;filesmatch&gt;&lt;br /&gt;   Header set Cache-Control "max-age=600"&lt;br /&gt;&lt;/filesmatch&gt;&lt;br /&gt;&lt;filesmatch&gt;&lt;br /&gt;   Header unset Cache-Control&lt;br /&gt;&lt;/filesmatch&gt;&lt;br /&gt;&lt;br /&gt;## ALTERNATE EXPIRES CACHING ###&lt;br /&gt;-&gt; htaccesselite.com/d/use-htaccess-to-speed-up-your-site-discussion-vt67.html&lt;br /&gt;ExpiresActive On&lt;br /&gt;ExpiresDefault A604800&lt;br /&gt;ExpiresByType image/x-icon A2592000&lt;br /&gt;ExpiresByType application/x-javascript A2592000&lt;br /&gt;ExpiresByType text/css A2592000&lt;br /&gt;ExpiresByType text/html A300&lt;br /&gt;&lt;filesmatch&gt;&lt;br /&gt;   ExpiresActive Off&lt;br /&gt;&lt;/filesmatch&gt;&lt;br /&gt;&lt;br /&gt;## META HTTP-EQUIV REPLACEMENTS ###&lt;br /&gt;&lt;filesmatch&gt;&lt;br /&gt;   Header set imagetoolbar "no"&lt;br /&gt;&lt;/filesmatch&gt;&lt;br /&gt;&lt;br /&gt;=============================================================================#&lt;br /&gt;          REWRITES AND REDIRECTS&lt;br /&gt;=============================================================================#&lt;br /&gt; REQUEST METHODS: GET,POST,PUT,DELETE,CONNECT,OPTIONS,PATCH,PROPFIND,&lt;br /&gt;                  PROPPATCH,MKCOL,COPY,MOVE,LOCK,UNLOCK&lt;br /&gt;##########&lt;br /&gt;&lt;br /&gt;## REWRITE DEFAULTS ###&lt;br /&gt;RewriteEngine On&lt;br /&gt;RewriteBase /&lt;br /&gt;&lt;br /&gt;## REQUIRE SUBDOMAIN ###&lt;br /&gt;RewriteCond %{HTTP_HOST} !^$&lt;br /&gt;RewriteCond %{HTTP_HOST} !^subdomain\.domain\.tld$ [NC]&lt;br /&gt;RewriteRule ^/(.*)$ http://subdomain.domain.tld/$1 [L,R=301]&lt;br /&gt;&lt;br /&gt;## SEO REWRITES ###&lt;br /&gt;RewriteRule ^(.*)/ve/(.*)$    $1/voluntary-employee/$2 [L,R=301]&lt;br /&gt;RewriteRule ^(.*)/hsa/(.*)$     $1/health-saving-account/$2 [L,R=301]&lt;br /&gt;&lt;br /&gt;## WORDPRESS ###&lt;br /&gt;RewriteCond %{REQUEST_FILENAME} !-f    # Existing File&lt;br /&gt;RewriteCond %{REQUEST_FILENAME} !-d    # Existing Directory&lt;br /&gt;RewriteRule . /index.php [L]&lt;br /&gt;&lt;br /&gt;## ALTERNATIVE ANTI-HOTLINKING ###&lt;br /&gt;RewriteCond %{HTTP_REFERER} !^$&lt;br /&gt;RewriteCond %{HTTP_REFERER} !^http://(subdomain\.)?domain.tld/.*$ [NC]&lt;br /&gt;RewriteRule ^.*\.(bmp|tif|gif|jpg|jpeg|jpe|png)$ - [F]&lt;br /&gt;&lt;br /&gt;## REDIRECT HOTLINKERS ###&lt;br /&gt;RewriteCond %{HTTP_REFERER} !^$&lt;br /&gt;RewriteCond %{HTTP_REFERER} !^http://(subdomain\.)?domain.tld/.*$ [NC]&lt;br /&gt;RewriteRule ^.*\.(bmp|tif|gif|jpg|jpeg|jpe|png)$ http://google.com [R]&lt;br /&gt;&lt;br /&gt;## DENY REQUEST BASED ON REQUEST METHOD ###&lt;br /&gt;RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK|OPTIONS|HEAD)$ [NC]&lt;br /&gt;RewriteRule ^.*$ - [F]&lt;br /&gt;&lt;br /&gt;## REDIRECT UPLOADS ###&lt;br /&gt;RewriteCond %{REQUEST_METHOD} ^(PUT|POST)$ [NC]&lt;br /&gt;RewriteRule ^(.*)$ /cgi-bin/form-upload-processor.cgi?p=$1 [L,QSA]&lt;br /&gt;&lt;br /&gt;## REQUIRE SSL EVEN WHEN MOD_SSL IS NOT LOADED ###&lt;br /&gt;RewriteCond %{HTTPS} !=on [NC]&lt;br /&gt;RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]&lt;br /&gt;&lt;br /&gt;### ALTERNATATIVE TO USING ERRORDOCUMENT ###&lt;br /&gt;-&gt; http://www.htaccesselite.com/d/htaccess-errordocument-examples-vt11.html&lt;br /&gt;RewriteCond %{REQUEST_FILENAME} !-f&lt;br /&gt;RewriteCond %{REQUEST_FILENAME} !-d&lt;br /&gt;RewriteRule ^.*$ /error.php [L]&lt;br /&gt;&lt;br /&gt;## SEO REDIRECTS ###&lt;br /&gt;Redirect 301 /2006/oldfile.html http://subdomain.domain.tld/newfile.html&lt;br /&gt;RedirectMatch 301 /o/(.*)$ http://subdomain.domain.tld/s/dl/$1&lt;br /&gt;&lt;br /&gt;=============================================================================#&lt;br /&gt;          AUTHENTICATION AND SECURITY&lt;br /&gt;=============================================================================#&lt;br /&gt; http://www.htaccesselite.com/basic-authentication-example-vt17.html&lt;br /&gt;&lt;br /&gt; Require (user|group|valid-user) (username|groupname)&lt;br /&gt;##########&lt;br /&gt;&lt;br /&gt;## BASIC PASSWORD PROTECTION ###&lt;br /&gt;AuthType basic&lt;br /&gt;AuthName "prompt"&lt;br /&gt;AuthUserFile /.htpasswd&lt;br /&gt;AuthGroupFile /dev/null&lt;br /&gt;Require valid-user&lt;br /&gt;&lt;br /&gt;## ALLOW FROM IP OR VALID PASSWORD ###&lt;br /&gt;Require valid-user&lt;br /&gt;Allow from 192.168.1.23&lt;br /&gt;Satisfy Any&lt;br /&gt;&lt;br /&gt;## PROTECT FILES ###&lt;br /&gt;&lt;filesmatch&gt;&lt;br /&gt;  Order Allow,Deny&lt;br /&gt;  Deny from all&lt;br /&gt;&lt;/filesmatch&gt;&lt;br /&gt;&lt;br /&gt;## PREVENT HOTLINKING ###&lt;br /&gt;SetEnvIfNoCase Referer "^http://subdomain.domain.tld/" good&lt;br /&gt;SetEnvIfNoCase Referer "^$" good&lt;br /&gt;&lt;filesmatch&gt;&lt;br /&gt;   Order Deny,Allow&lt;br /&gt;   Deny from all&lt;br /&gt;   Allow from env=good&lt;br /&gt;   ErrorDocument 403 http://www.google.com/intl/en_ALL/images/logo.gif&lt;br /&gt;   ErrorDocument 403 /images/you_bad_hotlinker.gif&lt;br /&gt;&lt;/filesmatch&gt;&lt;br /&gt;&lt;br /&gt;## LIMIT UPLOAD FILE SIZE TO PROTECT AGAINST DOS ATTACK ###&lt;br /&gt;LimitRequestBody 10240000 #bytes, 0-2147483647(2GB)&lt;br /&gt;&lt;br /&gt;=============================================================================#&lt;br /&gt;          SSL SECURITY&lt;br /&gt;=============================================================================#&lt;br /&gt;-&gt; http://www.askapache.com/htaccess/ssl-example-usage-in-htaccess.html&lt;br /&gt;##########&lt;br /&gt;&lt;br /&gt;## MOST SECURE WAY TO REQUIRE SSL ###&lt;br /&gt;-&gt; http://www.askapache.com/htaccess/apache-ssl-in-htaccess-examples.html&lt;br /&gt;SSLOptions +StrictRequire&lt;br /&gt;SSLRequireSSL&lt;br /&gt;SSLRequire %{HTTP_HOST} eq "domain.tld"&lt;br /&gt;ErrorDocument 403 https://domain.tld&lt;br /&gt;&lt;br /&gt;=============================================================================#&lt;br /&gt;          SITE UNDER CONSTRUCTION&lt;br /&gt;=============================================================================#&lt;br /&gt; Heres some awesome htaccess to use when you are developing a site&lt;br /&gt;##########&lt;br /&gt;&lt;br /&gt;## COMBINED DEVELOPER HTACCESS CODE-USE THIS ###&lt;br /&gt;&lt;filesmatch&gt;&lt;br /&gt;   Header set Cache-Control "max-age=5"&lt;br /&gt;&lt;/filesmatch&gt;&lt;br /&gt;AuthType basic&lt;br /&gt;AuthName "Ooops! Temporarily Under Construction..."&lt;br /&gt;AuthUserFile /.htpasswd&lt;br /&gt;AuthGroupFile /dev/null&lt;br /&gt;Require valid-user           # password prompt for everyone else&lt;br /&gt;Order Deny,Allow&lt;br /&gt;Deny from all&lt;br /&gt;Allow from 192.168.64.5      # Your, the developers IP address&lt;br /&gt;Allow from w3.org            # css/xhtml check jigsaw.w3.org/css-validator/&lt;br /&gt;Allow from googlebot.com     # Allows google to crawl your pages&lt;br /&gt;Satisfy Any                  # no password required if host/ip is Allowed&lt;br /&gt;&lt;br /&gt;## DONT HAVE TO EMPTY CACHE OR RELOAD TO SEE CHANGES ###&lt;br /&gt;ExpiresDefault A5 #If using mod_expires&lt;br /&gt;&lt;filesmatch&gt;&lt;br /&gt;   Header set Cache-Control "max-age=5"&lt;br /&gt;&lt;/filesmatch&gt;&lt;br /&gt;&lt;br /&gt;## ALLOW ACCESS WITH PASSWORD OR NO PASSWORD FOR SPECIFIC IP/HOSTS ###&lt;br /&gt;AuthType basic&lt;br /&gt;AuthName "Ooops! Temporarily Under Construction..."&lt;br /&gt;AuthUserFile /.htpasswd&lt;br /&gt;AuthGroupFile /dev/null&lt;br /&gt;Require valid-user           # password prompt for everyone else&lt;br /&gt;Order Deny,Allow&lt;br /&gt;Deny from all&lt;br /&gt;Allow from 192.168.64.5      # Your, the developers IP address&lt;br /&gt;Allow from w3.org            # css/xhtml check jigsaw.w3.org/css-validator/&lt;br /&gt;Allow from googlebot.com     # Allows google to crawl your pages&lt;br /&gt;Satisfy Any                  # no password required if host/ip is Allowed&lt;div class="blogger-post-footer"&gt;Taken From : Speedybiz Blog Network&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1343133296744135180-246785715720300173?l=speedybiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedybiz.blogspot.com/feeds/246785715720300173/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1343133296744135180&amp;postID=246785715720300173' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1343133296744135180/posts/default/246785715720300173'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1343133296744135180/posts/default/246785715720300173'/><link rel='alternate' type='text/html' href='http://speedybiz.blogspot.com/2008/07/htaccess-file-and-modrewrite-examples.html' title='.htaccess File and mod_rewrite examples'/><author><name>speedybiz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp1.blogger.com/_RJhWWe1VrV8/SFFGoy0rStI/AAAAAAAAAAU/aOr375h3bXI/S220/speedybiz_superhero.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1343133296744135180.post-2668624353029471026</id><published>2008-07-04T06:31:00.000+07:00</published><updated>2012-01-14T07:21:00.619+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SEO'/><title type='text'>How To Use .htaccess 301 Redirect</title><content type='html'>Using .htaccess to redirect your visitors from one page to another is the cleanest fastest way of making a redirect. This is the same method I use to redirect readers of this blog from DavePit.com to DavidPitlyuk.com. I do this because DavidPitlyuk.com may be too hard to spell, so I added DavePit.com which is easy, and added a simple re-direct to move the readers over to the correct domain.&lt;br /&gt;&lt;br /&gt;You can use .htaccess to redirect entire domains, folders, specific files, and more. John Chow uses an .htaccess redirect to set his preferred domain, something that can better your site from an SEO standpoint. I’ll go over how to do this as well.&lt;br /&gt;&lt;br /&gt;Things To Note&lt;br /&gt;&lt;br /&gt;Keep in mind that .htaccess is only supported on non-Windows servers, so any of you guys using Windows need to utilize another method to redirect your users. Also, if you are creating the .htaccess file in Windows, you’ll find that it doesn’t like filenames with no name on it. The workaround for this is to make the file something like htaccess.txt, and after uploading the file, rename on the server. Make sure to change http://www.example.com to your own domain name in any of the examples.&lt;br /&gt;&lt;br /&gt;So let’s go over a few common methods of using the redirect:&lt;br /&gt;&lt;br /&gt;Redirect An Entire Domain&lt;br /&gt;&lt;br /&gt;This is what I use to redirect everybody who accesses this site at DavePit.com and transfer them to DavidPitlyuk.com.&lt;br /&gt;&lt;br /&gt;Redirect 301 / http://www.example.com/&lt;br /&gt;&lt;br /&gt;Redirect non-WWW to WWW (example.com &gt; www.example.com)&lt;br /&gt;&lt;br /&gt;This is the setting the preferred domain that I was talking about earlier. It will redirect all of your traffic at the example.com level and transfer it to www.example.com&lt;br /&gt;&lt;br /&gt;Options +FollowSymLinks&lt;br /&gt;RewriteEngine on&lt;br /&gt;RewriteCond %{HTTP_HOST} ^example.com [NC]&lt;br /&gt;RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]&lt;br /&gt;&lt;br /&gt;Redirect A Single File Or Folder&lt;br /&gt;&lt;br /&gt;This will be used if you want to redirect something like http://www.example.com/blog2 to http://www.example.com/blog or http://www.example.com/blog.php to http://www.example.com/blog.&lt;br /&gt;&lt;br /&gt;Redirect 301 /OldPageOrDirectory.html http://www.example.com/NewPageOrDirectory.html&lt;br /&gt;&lt;br /&gt;There are many other methods of using .htaccess to redirect, but in the most cases this will cover what you need.&lt;div class="blogger-post-footer"&gt;Taken From : Speedybiz Blog Network&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1343133296744135180-2668624353029471026?l=speedybiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedybiz.blogspot.com/feeds/2668624353029471026/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1343133296744135180&amp;postID=2668624353029471026' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1343133296744135180/posts/default/2668624353029471026'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1343133296744135180/posts/default/2668624353029471026'/><link rel='alternate' type='text/html' href='http://speedybiz.blogspot.com/2008/07/how-to-use-htaccess-301-redirect.html' title='How To Use .htaccess 301 Redirect'/><author><name>speedybiz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp1.blogger.com/_RJhWWe1VrV8/SFFGoy0rStI/AAAAAAAAAAU/aOr375h3bXI/S220/speedybiz_superhero.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1343133296744135180.post-7827633769143736980</id><published>2008-07-04T06:27:00.000+07:00</published><updated>2012-01-14T07:15:27.832+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SEO'/><title type='text'>How to use .htaccess</title><content type='html'>introduction to .htaccess&lt;br /&gt;&lt;br /&gt;There’s a good reason why you won’t see .htaccess files on the web; almost every web server in the world is configured to ignore them, by default. Same goes for most operating systems. Mainly it’s the dot “.” at the start, you see?&lt;br /&gt;&lt;br /&gt;If you don’t see, you’ll need to disable your operating system’s invisible file functions, or use a text editor that allows you to open hidden files, something like bbedit on the Mac platform. On windows, showing invisibles in explorer should allow any text editor to open them, and most decent editors to save them too**. Linux dudes know how to find them without any help from me.&lt;br /&gt;Mac Finder view with invisible files&lt;br /&gt;that same folder, as seen from Mac OS X&lt;br /&gt;&lt;br /&gt;In both images, the operating system has been instructed to display invisible files. ugly, but necessary sometimes. You will also need to instruct your ftp client to do the same.&lt;br /&gt;&lt;br /&gt;By the way; the windows screencap is more recent than the mac one, moved files are likely being handled by my clever 404 script.&lt;br /&gt;&lt;br /&gt;** even notepad can save files beginning with a dot, if you put double-quotes around the name when you save it; i.e.. “.htaccess”. You can also use your ftp client to rename files beginning with a dot, even on your local filesystem; works great in FileZilla.&lt;br /&gt;&lt;br /&gt;What are .htaccess files anyway?&lt;br /&gt;Simply put, they are invisible plain text files where one can store server directives. Server directives are anything you might put in an Apache config file (httpd.conf) or even a php.ini**, but unlike those “master” directive files, these .htaccess directives apply only to the folder in which the .htaccess file resides, and all the folders inside.&lt;br /&gt;&lt;br /&gt;This ability to plant .htaccess files in any directory of our site allows us to set up a finely-grained tree of server directives, each subfolder inheriting properties from its parent, whilst at the same time adding to, or over-riding certain directives with its own .htaccess file. For instance, you could use .htacces to enable indexes all over your site, and then deny indexing in only certain subdirectories, or deny index listings site-wide, and allow indexing in certain subdirectories. One line in the .htaccess file in your root and your whole site is altered. From here on, I’ll probably refer to the main .htaccess in the root of your website as “the master .htaccess file”, or “main” .htaccess file.&lt;br /&gt;&lt;br /&gt;There’s a small performance penalty for all this .htaccess file checking, but not noticeable, and you’ll find most of the time it’s just on and there’s nothing you can do about it anyway, so let’s make the most of it..&lt;br /&gt;&lt;br /&gt;** Your main php.ini, that is, unless you are running under phpsuexec, in which case the directives would go inside individual php.ini files&lt;br /&gt;&lt;br /&gt;What can I do with .htaccess files?&lt;br /&gt;Almost any directive that you can put inside an httpd.conf file will also function perfectly inside an .htaccess file. Unsurprisingly, the most common use of .htaccess is to..&lt;br /&gt;&lt;br /&gt;control access&lt;br /&gt;.htaccess is most often used to restrict or deny access to individual files and folders. A typical example would be an “includes” folder. Your site’s pages can call these included scripts all they like, but you don’t want users accessing these files directly. In that case you would drop an .htaccess file in the includes folder with content something like this..&lt;br /&gt;&lt;br /&gt;NO ENTRY!&lt;br /&gt;# no one gets in here!&lt;br /&gt;deny from all&lt;br /&gt;&lt;br /&gt;which would deny ALL direct access to ANY files in that folder. You can be more specific with your conditions, for instance limiting access to a particular IP range, here’s a handy top-level rule for a local test server..&lt;br /&gt;&lt;br /&gt;NO ENTRY outside of the LAN!&lt;br /&gt;# no nasty crackers in here!&lt;br /&gt;order deny,allow&lt;br /&gt;deny from all&lt;br /&gt;allow from 192.168.0.0/24&lt;br /&gt;# this would do the same thing..&lt;br /&gt;#allow from 192.168.0&lt;br /&gt;&lt;br /&gt;Generally these sorts of requests would bounce off your firewall anyway, but on a live server (like my dev mirror sometimes is) they become useful for filtering out undesirable IP blocks, known risks, lots of things. By the way, in case you hadn’t spotted; lines beginning with “#” are ignored by Apache; handy for comments.&lt;br /&gt;&lt;br /&gt;Sometimes, you will only want to ban one IP, perhaps some persistent robot that doesn’t play by the rules..&lt;br /&gt;&lt;br /&gt;post user agent every fifth request only. hmmm. ban IP..&lt;br /&gt;# someone else giving the ruskies a bad name..&lt;br /&gt;order allow,deny&lt;br /&gt;deny from 83.222.23.219&lt;br /&gt;allow from all&lt;br /&gt;&lt;br /&gt;The usual rules for IP addresses apply, so you can use partial matches, ranges, and so on. Whatever, the user gets a 403 “access denied” error page in their client software (browser, usually), which certainly gets the message across. This is probably fine for most situations, but in part two I’ll demonstrate some cooler ways to deny access.&lt;br /&gt;&lt;br /&gt;custom error documents&lt;br /&gt;I guess I should briefly mention that .htaccess is where most folk configure their error documents. Usually with sommething like this..&lt;br /&gt;&lt;br /&gt;the usual method. the “err” folder (with the custom pages) is in the root&lt;br /&gt;# custom error documents&lt;br /&gt;ErrorDocument 401 /err/401.php&lt;br /&gt;ErrorDocument 403 /err/403.php&lt;br /&gt;ErrorDocument 404 /err/404.php&lt;br /&gt;ErrorDocument 500 /err/500.php&lt;br /&gt;&lt;br /&gt;You can also specify external URLs, though this can be problematic, and is best avoided. One quick and simple method is to specify the text in the directive itself, you can even use HTML (though there is probably a limit to how much HTML you can squeeze onto one line). Remember to begin with a “, but DO NOT end with one.&lt;br /&gt;&lt;br /&gt;measure twice, quote once..&lt;br /&gt;# quick custom error “document”..&lt;br /&gt;NO! ErrorDocument 404 “&lt;br /&gt;There is nothing here.. go away quickly!&lt;br /&gt;&lt;br /&gt;Using a custom error document is a Very Good Idea, and will give you a second chance at your almost-lost visitors. I recommend you download mine. But then, I would.&lt;br /&gt;&lt;br /&gt;password protected directories&lt;br /&gt;The next most obvious use for our .htaccess files is to allow access to only specific users, or user groups, in other words; password protected folders. a simple authorisation mechanism might look something like this..&lt;br /&gt;&lt;br /&gt;a simple sample .htaccess file for password protection:&lt;br /&gt;AuthType Basic&lt;br /&gt;AuthName “restricted area”&lt;br /&gt;AuthUserFile /usr/local/var/www/html/.htpasses&lt;br /&gt;require valid-user&lt;br /&gt;&lt;br /&gt;You can use this same mechanism to limit only certain kinds of requests, too..&lt;br /&gt;&lt;br /&gt;only valid users can POST in here, anyone can GET, PUT, etc:&lt;br /&gt;AuthType Basic&lt;br /&gt;AuthName “restricted area”&lt;br /&gt;AuthUserFile /usr/local/var/www/html/.htpasses&lt;br /&gt;&lt;br /&gt;require valid-user&lt;br /&gt;&lt;br /&gt;You can find loads of online examples of how to setup authorization using .htaccess, and so long as you have a real user (or create one, in this case, ‘jimmy’) with a real password (you will be prompted for this, twice) in a real password file (the -c switch will create it)..&lt;br /&gt;&lt;br /&gt;htpasswd -c /usr/local/var/www/html/.htpasses jimmy&lt;br /&gt;&lt;br /&gt;..the above will work just fine. htpasswd is a tool that comes free with Apache, specifically for making and updating password files, check it out. The windows version is the same; only the file path needs to be changed; to wherever you want to put the password file.&lt;br /&gt;&lt;br /&gt;Note: if the Apache bin/ folder isn’t in your PATH, you will need to cd into that directory before performing the command. Also note: You can use forward and back-slashes interchangeably with Apache/php on Windows, so this would work just fine..&lt;br /&gt;&lt;br /&gt;htpasswd -c c:/unix/usr/local/Apache2/conf/.htpasses jimmy&lt;br /&gt;&lt;br /&gt;Relative paths are fine too; assuming you were inside the bin/ directory of our fictional Apache install, the following would do exactly the same as the above..&lt;br /&gt;&lt;br /&gt;htpasswd -c ../conf/.htpasses jimmy&lt;br /&gt;&lt;br /&gt;Naming the password file .htpasses is a habit from when I had to keep that file inside the web site itself, and as web servers are configured to ignore files beginning with .ht, they too, remain hidden. If you keep your password file outside the web root (a better idea), then you can call it whatever you like, but the .ht_something habit is a good one to keep, even inside the web tree, it is secure enough for our basic purpose..&lt;br /&gt;&lt;br /&gt;Once they are logged in, you can access the remote_user environmental variable, and do stuff with it..&lt;br /&gt;&lt;br /&gt;the remote_user variable is now available..&lt;br /&gt;RewriteEngine on&lt;br /&gt;RewriteCond %{remote_user} !^$ [nc]&lt;br /&gt;RewriteRule ^(.*)$ /users/%{remote_user}/$1&lt;br /&gt;&lt;br /&gt;Which is a handy directive, utilizing mod_rewrite; a subject I delve into far more deeply, in part two.&lt;br /&gt;&lt;br /&gt;get better protection..&lt;br /&gt;The authentication examples above assume that your web server supports “Basic” http authorisation, as far as I know they all do (it’s in the Apache core). Trouble is, some browsers aren’t sending password this way any more, personally I’m looking to php to cover my authorization needs. Basic auth works okay though, even if it isn’t actually very secure - your password travels in plain text over the wire, not clever.&lt;br /&gt;&lt;br /&gt;If you have php, and are looking for a more secure login facility, check out pajamas. It’s free. If you are looking for a password-protected download facility (and much more, besides), check out my distro machine, also free.&lt;br /&gt;&lt;br /&gt;500 error&lt;br /&gt;If you add something that the server doesn’t understand or support, you will get a 500 error page, aka.. “the server did a boo-boo”. Even directives that work perfectly on your test server at home may fail dramatically at your real site. In fact this is a great way to find out if .htaccess files are enabled on your site; create one, put some gibberish in it, and load a page in that folder, wait for the 500 error. if there isn’t one, probably they are not enabled.&lt;br /&gt;&lt;br /&gt;If they are, we need a way to safely do live-testing without bringing the whole site to a 500 standstill.&lt;br /&gt;&lt;br /&gt;Fortunately, in much the same way as we used the&lt;br /&gt;tag above, we can create conditional directives, things which will only come into effect if certain conditions are true. The most useful of these is the “ifModule” condition, which goes something like this..&lt;br /&gt;&lt;br /&gt;only if PHP is loaded, will this directive have any effect&lt;br /&gt;&lt;br /&gt;php_value default_charset utf-8&lt;br /&gt;&lt;br /&gt;..which placed in your master .htaccess file, that would set the default character encoding of your entire site to utf-8 (a good idea!), at least, anything output by PHP. If the PHP4 module isn’t running on the server, the above .htaccess directive will do exactly nothing; Apache just ignores it. As well as proofing us against knocking the server into 500 mode, this also makes our .htaccess directives that wee bit more portable. Of course, if your syntax is messed-up, no amount of if-module-ing is going to prevent a error of some kind, all the more reason to practice this stuff on a local test server.&lt;br /&gt;&lt;br /&gt;groovy things to do with .htaccess&lt;br /&gt;So far we’ve only scratched the surface. aside from authorisation, the humble .htaccess file can be put to all kinds of uses. If you’ve ever had a look in my public archives you will have noticed that that the directories are fully browsable, just like in the old days before adult web hosts realized how to turn that feature off! a line like this..&lt;br /&gt;&lt;br /&gt;bring back the directories!&lt;br /&gt;Options +Indexes +MultiViews +FollowSymlinks&lt;br /&gt;&lt;br /&gt;will almost certainly turn it back on again. And if you have mod_autoindex.c installed on your server (probably, yes), you can get nice fancy indexing, too..&lt;br /&gt;&lt;br /&gt;show me those files!&lt;br /&gt;&lt;br /&gt;IndexOptions FancyIndexing&lt;br /&gt;&lt;br /&gt;..which, as well as being neater, allows users to click the titles and, for instance, order the listing by date, or file size, or whatever. It’s all for free too, built-in to the server, we’re just switching it on. You can control certain parameters too..&lt;br /&gt;&lt;br /&gt;let’s go all the way!&lt;br /&gt;&lt;br /&gt;IndexOptions FancyIndexing IconHeight=16 IconWidth=16&lt;br /&gt;&lt;br /&gt;Other parameters you could add include..&lt;br /&gt;&lt;br /&gt;NameWidth=30&lt;br /&gt;DescriptionWidth=30&lt;br /&gt;IconsAreLinks SuppressHTMLPreamble (handy!)&lt;br /&gt;&lt;br /&gt;I’m not mentioning the “XHTML” parameter in Apache2, because it still isn’t! Anyways, I’ve chucked one of my old fancy indexing .htaccess file onsite for you to have some fun with. Just add readme.html and away you go! note: these days I use a single header files for all the indexes, and only drop in local “readme” files. Check out the example, and my public archives for more details.&lt;br /&gt;&lt;br /&gt;custom directory index files&lt;br /&gt;While I’m here, it’s worth mentioning that .htaccess is where you can specify which files you want to use as your indexes, that is, if a user requests /foo/, Apache will serve up /foo/index.html, or whatever file you specify.&lt;br /&gt;&lt;br /&gt;You can also specify multiple files, and Apache will look for each in order, and present the first one it finds. It’s generally setup something like..&lt;br /&gt;&lt;br /&gt;DirectoryIndex index.html index.php index.htm&lt;br /&gt;&lt;br /&gt;It really is worth scouting around the Apache documentation, often you will find controls for things you imagined were uncontrollable, thereby creating new possibilities, better options for your website. My experience of the magic “LAMP” (Linux-Apache-MySQL-PHP) has been.. “If you can imagine that it can be done, it can be done”. Swap “Linux” for any decent operating system, the “AMP” part runs on most of them.&lt;br /&gt;&lt;br /&gt;Okay, so now we have nice fancy directories, and some of them password protected, if you don’t watch out, you’re site will get popular, and that means bandwidth..&lt;br /&gt;&lt;br /&gt;save bandwidth with .htaccess!&lt;br /&gt;If you pay for your bandwidth, this wee line could save you hard cash..&lt;br /&gt;&lt;br /&gt;save me hard cash! and help the internet!&lt;br /&gt;&lt;br /&gt;php_value zlib.output_compression 16386&lt;br /&gt;&lt;br /&gt;All it does is enables PHP’s built-in transparent zlib compression. This will half your bandwidth usage in one stroke, more than that, in fact. Of course it only works with data being output by the PHP module, but if you design your pages with this in mind, you can use php echo statements, or better yet, php “includes” for your plain html output and just compress everything! Remember, if you run phpsuexec, you’ll need to put php directives in a local php.ini file, not .htaccess. See here for more details.&lt;br /&gt;&lt;br /&gt;hide and deny files&lt;br /&gt;Do you remember I mentioned that any file beginning with .ht is invisible? ..”almost every web server in the world is configured to ignore them, by default” and that is, of course, because .ht_anything files generally have server directives and passwords and stuff in them, most servers will have something like this in their main configuration..&lt;br /&gt;&lt;br /&gt;Standard setting..&lt;br /&gt;&lt;br /&gt;Order allow,deny&lt;br /&gt;Deny from all&lt;br /&gt;Satisfy All&lt;br /&gt;&lt;br /&gt;which instructs the server to deny access to any file beginning with .ht, effectively protecting our .htaccess and other files. The “.” at the start prevents them being displayed in an index, and the .ht prevents them being accessed. This version..&lt;br /&gt;&lt;br /&gt;ignore what you want&lt;br /&gt;&lt;br /&gt;Order allow,deny&lt;br /&gt;Deny from all&lt;br /&gt;Satisfy All&lt;br /&gt;&lt;br /&gt;tells the server to deny access to *.log files. You can insert multiple file types into each rule, separating them with a pipe “|”, and you can insert multiple blocks into your .htaccess file, too. I find it convenient to put all the files starting with a dot into one, and the files with denied extensions into another, something like this..&lt;br /&gt;&lt;br /&gt;the whole lot&lt;br /&gt;# deny all .htaccess, .DS_Store $hî†é and ._* (resource fork) files&lt;br /&gt;&lt;br /&gt;Order allow,deny&lt;br /&gt;Deny from all&lt;br /&gt;Satisfy All&lt;br /&gt;&lt;br /&gt;# deny access to all .log and .comment files&lt;br /&gt;&lt;br /&gt;Order allow,deny&lt;br /&gt;Deny from all&lt;br /&gt;Satisfy All&lt;br /&gt;&lt;br /&gt;would cover all ._* resource fork files, .DS_Store files (which the Mac Finder creates all over the place) *.log files, *.comment files and of course, our .ht* files. You can add whatever file types you need to protect from direct access. I think it’s clear now why the file is called “.htaccess”.&lt;br /&gt;These days, using is preferred over , mainly because you can use regular expression in the conditions (very handy), produce clean, more readable code. Here’s an example. which I use for my php-generated style sheets..&lt;br /&gt;&lt;br /&gt;parse file.css and file.style with the php machine..&lt;br /&gt;# handler for phpsuexec..&lt;br /&gt;&lt;br /&gt;SetHandler application/x-httpd-php&lt;br /&gt;&lt;br /&gt;Any files matching the regular expression statement, that is files with a *.css or *.style extension, will now be handled by php, rather than simply served up by Apache. Any statements you come across can be advantageously replaced by statements. Good to know.&lt;div class="blogger-post-footer"&gt;Taken From : Speedybiz Blog Network&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1343133296744135180-7827633769143736980?l=speedybiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedybiz.blogspot.com/feeds/7827633769143736980/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1343133296744135180&amp;postID=7827633769143736980' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1343133296744135180/posts/default/7827633769143736980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1343133296744135180/posts/default/7827633769143736980'/><link rel='alternate' type='text/html' href='http://speedybiz.blogspot.com/2008/07/how-to-use-htaccess.html' title='How to use .htaccess'/><author><name>speedybiz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp1.blogger.com/_RJhWWe1VrV8/SFFGoy0rStI/AAAAAAAAAAU/aOr375h3bXI/S220/speedybiz_superhero.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1343133296744135180.post-8975896458464996312</id><published>2008-07-04T06:22:00.001+07:00</published><updated>2012-01-14T07:15:27.832+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SEO'/><title type='text'>Tips and Examples for how to use your .htaccess file</title><content type='html'>.htaccess file explained with examples for eliminating referrer spam and deep linking&lt;br /&gt;&lt;br /&gt;Someone recently asked how to block a particular IP address from their&lt;br /&gt;web site. the .htaccess file is a good way to do this. I’m assuming&lt;br /&gt;that you can google for information about where to put your .htaccess&lt;br /&gt;file, and am only going to address some ways to populate your .htaccess&lt;br /&gt;file to accomplish some routine access control and URL rewriting.&lt;br /&gt;&lt;br /&gt;For more information on URL rewriting do a google search for:&lt;br /&gt;+mod_rewrite +documentation&lt;br /&gt;or&lt;br /&gt;+mod_rewrite +examples&lt;br /&gt;&lt;br /&gt;Topics covered are:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    * A brief introduction to Regular Expressions&lt;br /&gt;    * Denying access based on IP address of browser&lt;br /&gt;    * Denying access based on HTTP_REFERER&lt;br /&gt;    * Denying linking or deep linking of images on your site&lt;br /&gt;    * Sending naughty users to “good” content elsewhere on the web&lt;br /&gt;    * Rewriting URLs in order to remedy an incorrect URL posting to email lists&lt;br /&gt;&lt;br /&gt;The statements or directives that are used in my .htaccess file are what are known as "regular expressions". This site seems to be comprehensive, and was at the top of the google search for "regular expressions".&lt;br /&gt;&lt;br /&gt;Here are a couple of quick explanations for what's being done in my .htaccess file.&lt;br /&gt;&lt;br /&gt;    * ^ refers to the beginning of a string. So any regex that has ^ in it means "starts with"&lt;br /&gt;    * $ refers to the end of the string. So any regex that ends with $ means "ends with" the previous character&lt;br /&gt;    * ! is negation. Anywhere you see a ! (aka "bang"), it means not. so !string, matches everything except string&lt;br /&gt;    * . means any single character&lt;br /&gt;    * * means one of more of the preceding character. Hence .* is like the UNIX or DOS * wildcard&lt;br /&gt;    * | is a logical OR. I explain more about it below.&lt;br /&gt;    * \ escapes the "special characters" just described. So if I wanted to match a . I would write the regex \.&lt;br /&gt;&lt;br /&gt;So to put a couple of these together:&lt;br /&gt;&lt;br /&gt;    * ^$ refers to a string that starts and stops with nothing in between, also known as an empty string, as there's nothing in it.&lt;br /&gt;    * ^stevem.* refers to a string that starts with stevem and then may contain any number of any characters.&lt;br /&gt;    * ^shooter\.net$ refers to a string that contains only "shooter.net"&lt;br /&gt;&lt;br /&gt;I describe how I've setup these regexs below using the characters described above...&lt;br /&gt;&lt;br /&gt;Use Google for more info.&lt;br /&gt;&lt;br /&gt;Another thing to note: In a couple of the directives in my .htaccess file I block some rather large chunks of the Internet from getting to my web site. I'm doing this because I want to be sure that I've blocked irritating (usually referrer spammers -- SCUM) from hitting my site and I've used a whois server to find out what the netblock boundaries are, and blocked the entire netblock. I also keep a close eye on my access log to see who is being denied access to my site. I strongly suggest that if you don't know what you're doing, don't take such extreme measures, and instead block complete single IP addresses instead of networks.&lt;br /&gt;&lt;br /&gt;And most of all, be careful and make sure you understand what you are doing in your .htaccess file. Then TEST TEST TEST to make sure it's accomplishing what you want and that you haven't crippled your site.&lt;br /&gt;&lt;br /&gt;.htaccess files are powerful tools for fine tuning access to your web site. To paraphrase a famouse comic book uncle, "With great power comes the ablity to really screw things up."&lt;br /&gt;&lt;br /&gt;Here is a copy of my .htaccess file with inline comments attempting to describe what I'm doing.&lt;br /&gt;&lt;br /&gt;## The next several statements set a variable, (BadAgent, BadReferer, BadAddy)&lt;br /&gt;## if the condition is met. the three deny lines below cause the &lt;br /&gt;## 403 Denied to be issued&lt;br /&gt;&lt;br /&gt;## This identifies a couple of irritating User-Agents&lt;br /&gt;SetEnvIfNoCase User-Agent ".*(AdultGods|php/perl).*" BadAgent&lt;br /&gt;&lt;br /&gt;## This identifies a couple irritating Referers&lt;br /&gt;SetEnvIfNoCase Referer ".*(x-stories|plattendreher|pureteen|stormfront).*" BadReferer&lt;br /&gt;&lt;br /&gt;## This blocks some IP addresses that I don't like this is a rather complex regular expression&lt;br /&gt;## the () symbols contain a group of expressions separated by the pipe symbol |&lt;br /&gt;## the | acts as a logical OR.&lt;br /&gt;## so for example, we match a string that contains one or more of any character: .*&lt;br /&gt;## that contains one of those three IP addresses listed in the ()s&lt;br /&gt;## and then can be followed by one or more of any (or none at all) characaters.&lt;br /&gt;## Do some searching on google if you really want to dig this deeply into regexs&lt;br /&gt;##&lt;br /&gt;SetEnvIfNoCase REMOTE_ADDR ".*(193.194.84.1|69.31.86.133|205.252.49.146).*" BadAddy&lt;br /&gt;&lt;br /&gt;## This blocks an entire class B... It's all owned by one ISP, and the&lt;br /&gt;## referrer spam was coming from a dozen or more networks contained in this netblock&lt;br /&gt;SetEnvIfNoCase REMOTE_ADDR "66.154.*" BadAddy&lt;br /&gt;&lt;br /&gt;## This blocks two class B networks. Same story as above. However,&lt;br /&gt;## the \. included below makes sure that we only block two networks&lt;br /&gt;## 198.25.0.0 and 198.26.0.0  if we had left out the .\ we would have matched&lt;br /&gt;## HUNDREDS of networks, like 198.251.0.0 and 198.268.0.0 etc...&lt;br /&gt;##&lt;br /&gt;SetEnvIfNoCase REMOTE_ADDR "198.2(5|6)\..*" BadAddy&lt;br /&gt;&lt;br /&gt;## Here's where we setup the denials if there were matches above&lt;br /&gt;order deny,allow&lt;br /&gt;deny from env=BadAgent&lt;br /&gt;deny from env=BadReferer&lt;br /&gt;deny from env=BadAddy&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;## This part of the .htaccess file is where I do some URL rewriting&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;## Gotta turn on the engine if we're going to get anywhere&lt;br /&gt;RewriteEngine on&lt;br /&gt;&lt;br /&gt;## These two rules cause requests for  atom and rss requests to the&lt;br /&gt;## docroot of my site to be rewritten to use ExpressionEngine system&lt;br /&gt;## so they are properly served&lt;br /&gt;##&lt;br /&gt;RewriteRule  .*atom.xml$ http://www.shooter.net/index.php/weblog/rss_atom/ [R]&lt;br /&gt;RewriteRule  .*rss.xml$ http://www.shooter.net/index.php/weblog/rss_2.0/ [R]&lt;br /&gt;&lt;br /&gt;## This commented out rule causes all requests for index.html to be&lt;br /&gt;## rewritten to use ExpressionEngine. It was in place as I was migrating&lt;br /&gt;## and I wanted everything directed into EE instead of using my old static pages.&lt;br /&gt;##&lt;br /&gt;#RewriteRule  /.*index.html$ http://www.shooter.net/index.php [R]&lt;br /&gt;&lt;br /&gt;## I posted an email to a mailing list announcing this article, but I&lt;br /&gt;## somehow managed to screw it up. This entry fixes it so I didn't&lt;br /&gt;## have to post an "I'm a dummy" followup&lt;br /&gt;## see if you can figure out the incorrect URL that I posted&lt;br /&gt;##&lt;br /&gt;RewriteRule  ^using-a-polarizer/  http://www.shooter.net/index.php/weblog/Item/using-a-polarizer/ [R]&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;## This is how I prevent other sites from linking to my images, a practice&lt;br /&gt;## also known as "deep linking". It pisses me off that in spite of my&lt;br /&gt;## copyright notice, forbidding this practice, some people think it's okay&lt;br /&gt;## to steal my work, and steal my bandwidth too...&lt;br /&gt;##&lt;br /&gt;##&lt;br /&gt;## This line says, only match if the HTTP_REFERER environment variable is&lt;br /&gt;## not empty otherwise fall out of this series of conditionals. So if&lt;br /&gt;## there is no HTTP_REFERER set, we drop out of this set of conditionals,&lt;br /&gt;## which means that we don't execute the RewriteRule at the end of this&lt;br /&gt;## block of conditionals.&lt;br /&gt;## &lt;br /&gt;RewriteCond %{HTTP_REFERER} !^$&lt;br /&gt;&lt;br /&gt;## This is a case insensitive (because of the [NC] flag) expression&lt;br /&gt;## that causes any referrals from shooter.net to exits from this series&lt;br /&gt;## of conditionals&lt;br /&gt;##&lt;br /&gt;RewriteCond %{HTTP_REFERER} !.*shooter.net.* [NC]&lt;br /&gt;&lt;br /&gt;## dicelady.com is my mom's web site. Since we're sharing the installation&lt;br /&gt;## of ExpressionEngine, I want to serve images for her... So if the&lt;br /&gt;## HTTP_REFERER is not from her site we stay in this series of&lt;br /&gt;## conditionals, if it is from her site, the request drops out of this&lt;br /&gt;## series of conditionals,&lt;br /&gt;##&lt;br /&gt;RewriteCond %{HTTP_REFERER} !^http://www.dicelady.com/.*$ [NC]&lt;br /&gt;&lt;br /&gt;## Here's the action item. If we have a referrer, and it's not from&lt;br /&gt;## shooter.net or dicelady.com and the request ends in jpg, then no matter&lt;br /&gt;## what image they requested, we're going to serve them up a gif file that&lt;br /&gt;## is a reminder to not steal my images...&lt;br /&gt;##&lt;br /&gt;RewriteRule  .*\.jpg$ http://shooter.net/ah.ha.1.gif [R]&lt;br /&gt;&lt;br /&gt;## The website name has been changed to prevent the guilty&lt;br /&gt;## from knowing how I did what I did...&lt;br /&gt;##&lt;br /&gt;## This one is kinda fun. There is a website whose domain&lt;br /&gt;## name contains "hatemongersite". They are a white supremecist&lt;br /&gt;## website that was linking to my images of same-sex weddings.&lt;br /&gt;## And saying derogatory ugly things about the people that I&lt;br /&gt;## took pictures of... So, ANY request for ANYTHING from my&lt;br /&gt;## site that originates from this website, gets redirected to&lt;br /&gt;## a TOLERANCE site, and is served a nice pdf pamphlet about&lt;br /&gt;## "promoting tolerance" The nice thing about sending them a&lt;br /&gt;## pdf is most web browsers will launch a help app, adobe acrobat&lt;br /&gt;## to display the pdf... So they are browsing along, and suddenly they&lt;br /&gt;## have a "promoting tolerance" pdf being displayed...&lt;br /&gt;##&lt;br /&gt;RewriteCond %{HTTP_REFERER} ^http://.*hatemongersite.*$ [NC]&lt;br /&gt;RewriteRule  .* http://www.tolerance.org/101_tools/101_tools.pdf [R]&lt;br /&gt;&lt;br /&gt;## This one is simple. Requests from a site the irritated me&lt;br /&gt;## are rewritten to send them to a site with a very large pipe&lt;br /&gt;## and an 8mb thermal image of tokyo!&lt;br /&gt;##&lt;br /&gt;RewriteCond %{HTTP_REFERER} ^http://.*popmiranda.*$ [NC]&lt;br /&gt;RewriteRule  .* http://vvvvvvv.vv.vvv.vvv/gallery/images/tokyo.jpg [R]&lt;br /&gt;&lt;br /&gt;## Here's how you can redirect traffic from a certain address or range&lt;br /&gt;## of addresses to another site... This was the network that included&lt;br /&gt;## several users from the hatemongersite (IP changed to protect the guilty)&lt;br /&gt;## I point them at the "promoting tolerance" pdf.&lt;br /&gt;##&lt;br /&gt;RewriteCond %{REMOTE_ADDR} 192.168.10.*&lt;br /&gt;RewriteRule  .*\.html$ http://www.tolerance.org/101_tools/101_tools.pdf [R]&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So that's about it... I hope you've enjoyed this little jaunt through my .htaccess file.&lt;div class="blogger-post-footer"&gt;Taken From : Speedybiz Blog Network&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1343133296744135180-8975896458464996312?l=speedybiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedybiz.blogspot.com/feeds/8975896458464996312/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1343133296744135180&amp;postID=8975896458464996312' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1343133296744135180/posts/default/8975896458464996312'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1343133296744135180/posts/default/8975896458464996312'/><link rel='alternate' type='text/html' href='http://speedybiz.blogspot.com/2008/07/tips-and-examples-for-how-to-use-your.html' title='Tips and Examples for how to use your .htaccess file'/><author><name>speedybiz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp1.blogger.com/_RJhWWe1VrV8/SFFGoy0rStI/AAAAAAAAAAU/aOr375h3bXI/S220/speedybiz_superhero.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1343133296744135180.post-8513865939384822361</id><published>2008-07-04T06:16:00.000+07:00</published><updated>2012-01-14T07:21:00.619+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SEO'/><title type='text'>Others htaccess Trick</title><content type='html'>The Apache Web server provides a feature called .htaccess file, which provides commands to control a Web site. This file is simply a text file containing Apache directives. Those directives apply to the documents in the directory where the file is located, and to all subdirectories under it as well. Other .htaccess files in subdirectories may change or nullify the effects of those in parent directories.&lt;br /&gt;&lt;br /&gt;You have to be careful when editing .htaccess files, as a small mistake can make your Web site stop working. You should immediately test the site to be sure it works.&lt;br /&gt;&lt;br /&gt;You can use any text editor to create or make changes to .htaccess files. Keep in mind that commands in these files should be placed on one line only, so if your text editor uses word-wrap, make sure it's disabled. Be sure .htaccess file is uploaded in ASCII mode, not BINARY, or it won't work.&lt;br /&gt;&lt;br /&gt;Your text editor or operating system may probably not allow to save file as .htaccess. The solution is to save the file as htaccess.txt and upload it to your server. After doing that, you should use your FTP client and rename the file to it's proper name.&lt;br /&gt;&lt;br /&gt;Some sites do not allow use of .htaccess files, since they can slow down a server overloaded with domains if they're all using such files, and some things that they can do can compromise a server configuration that has been specifically setup by the admin. Just be sure to read their TOS carefully or ask permission from your host.&lt;br /&gt;&lt;br /&gt;Here are the most notable and useful .htaccess examples...&lt;br /&gt;Custom error pages&lt;br /&gt;&lt;br /&gt;The most common errors are 404 (Not Found) and 500 (Internal Server Error). Design your custom Web pages for these errors (you aren't limited to these errors, you can create an error page for each and every error). Add the following commands to your .htaccess file...&lt;br /&gt;ErrorDocument 404 /404.html&lt;br /&gt;ErrorDocument 500 /500.html&lt;br /&gt;&lt;br /&gt;You can name the pages anything you want, and you can place them anywhere you want within your site. The initial slash in the directory location represents the root directory of your site.&lt;br /&gt;Enabling SSI&lt;br /&gt;&lt;br /&gt;If you want to use SSI, but can't do so with your current Web host, you can change that with .htaccess file. The following lines tell the server that any file named .shtml should be parsed for server side commands...&lt;br /&gt;AddType text/html .shtml&lt;br /&gt;AddHandler server-parsed .shtml&lt;br /&gt;Options Indexes FollowSymLinks Includes&lt;br /&gt;&lt;br /&gt;If you don't care about the performance hit of having all .html files parsed for SSI, change the second line to...&lt;br /&gt;AddHandler server-parsed .shtml .html&lt;br /&gt;&lt;br /&gt;If you're going to keep SSI pages with the extension of .shtml, and you want to use SSI on your index pages, you need to add the following line to your .htaccess file...&lt;br /&gt;DirectoryIndex index.shtml index.html&lt;br /&gt;&lt;br /&gt;This allows a page named index.shtml to be your default page, and if that isn't found, index.html is loaded.&lt;br /&gt;Redirects&lt;br /&gt;&lt;br /&gt;You can use .htaccess file to redirect any request for a specific page to a new page...&lt;br /&gt;Redirect /OldDir/old.html http://site.com/NewDir/new.html&lt;br /&gt;&lt;br /&gt;Server-side redirects are very useful for shortening affiliate links. Your visitors won't be turned off by long links that are obviously affiliate links. For example, to create a redirect at the URL:&lt;br /&gt;http://YourSite.com/link&lt;br /&gt;to point to the URL:&lt;br /&gt;http://www.MerchantDomain.com/affil.cgi?12345&lt;br /&gt;put this line in your .htaccess file...&lt;br /&gt;Redirect /link http://www.MerchantDomain.com/affil.cgi?12345&lt;br /&gt;Protecting your bandwidth&lt;br /&gt;&lt;br /&gt;"Bandwidth stealing," also known as "hot linking," is linking directly to non-html objects on another server, such as images, electronic books etc. The most common practice of hot linking pertains to another site's images.&lt;br /&gt;&lt;br /&gt;To disallow hot linking on your server, create the following .htaccess file and upload it to the folder that contains the images you wish to protect...&lt;br /&gt;RewriteEngine on&lt;br /&gt;RewriteCond %{HTTP_REFERER} !^$&lt;br /&gt;RewriteCond %{HTTP_REFERER} !^http://(www\.)?YourSite\.com/.*$ [NC]&lt;br /&gt;RewriteRule \.(gif|jpg)$ - [F]&lt;br /&gt;&lt;br /&gt;Replace "YourSite.com" with your own. The above code causes a broken image to be displayed when it's hot linked. If you'd like to display an alternate image in place of the hot linked one, replace the last line with...&lt;br /&gt;RewriteRule \.(gif|jpg)$ http://www.YourSite.com/stop.gif [R,L]&lt;br /&gt;&lt;br /&gt;Replace "YourSite.com" and stop.gif with your real names.&lt;br /&gt;Preventing directory listing&lt;br /&gt;&lt;br /&gt;Typically servers are setup to prevent directory listing, but often they aren't. If you have a directory full of downloads or images that you don't want people to be able to browse through, add the following line to your .htaccess file...&lt;br /&gt;IndexIgnore *&lt;br /&gt;&lt;br /&gt;The * matches all files. If, for example, you want to prevent only listing of images, use...&lt;br /&gt;IndexIgnore *.gif *.jpg&lt;br /&gt;Redirecting YourSite.com to www.YourSite.com&lt;br /&gt;&lt;br /&gt;If search engines find both www and non-www links from other sites to your site, they may treat http://YourSite.com and http://www.YourSite.com as two different websites with the same content. This means that your site can be penalized for duplicate content.&lt;br /&gt;&lt;br /&gt;Many experts recommend to set up a 301 redirect (permanent redirect) from YourSite.com to www.YourSite.com...&lt;br /&gt;RewriteEngine On&lt;br /&gt;RewriteCond %{HTTP_HOST} ^YourSite\.com [nc]&lt;br /&gt;RewriteRule (.*) http://www.YourSite.com/$1 [R=301,L]&lt;br /&gt;&lt;br /&gt;Replace "YourSite.com" with your real domain name.&lt;div class="blogger-post-footer"&gt;Taken From : Speedybiz Blog Network&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1343133296744135180-8513865939384822361?l=speedybiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedybiz.blogspot.com/feeds/8513865939384822361/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1343133296744135180&amp;postID=8513865939384822361' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1343133296744135180/posts/default/8513865939384822361'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1343133296744135180/posts/default/8513865939384822361'/><link rel='alternate' type='text/html' href='http://speedybiz.blogspot.com/2008/07/others-htaccess-trick.html' title='Others htaccess Trick'/><author><name>speedybiz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp1.blogger.com/_RJhWWe1VrV8/SFFGoy0rStI/AAAAAAAAAAU/aOr375h3bXI/S220/speedybiz_superhero.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1343133296744135180.post-4141617423710777143</id><published>2008-07-04T06:05:00.000+07:00</published><updated>2012-01-14T07:21:00.620+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SEO'/><title type='text'>Superb htaccess Tricks</title><content type='html'>General Information&lt;br /&gt;&lt;br /&gt;.htaccess Definition1&lt;br /&gt;&lt;br /&gt;Apache server software provides distributed (i.e., directory-level) configuration via Hypertext Access files. These .htaccess files enable the localized fine-tuning of Apache’s universal system-configuration directives, which are defined in Apache’s main configuration file. The localized .htaccess directives must operate from within a file named .htaccess. The user must have appropriate file permissions to access and/or edit the .htaccess file. Further, .htaccess file permissions should never allow world write access — a secure permissions setting is “644”, which allows universal read access and user-only write access. Finally, .htaccess rules apply to the parent directory and all subdirectories. Thus to apply configuration rules to an entire website, place the .htaccess file in the root directory of the site.&lt;br /&gt;&lt;br /&gt;Commenting .htaccess Code&lt;br /&gt;&lt;br /&gt;Comments are essential to maintaining control over any involved portion of code. Comments in .htaccess code are fashioned on a per-line basis, with each line of comments beginning with a pound sign #. Thus, comments spanning multiple lines in the .htaccess file require multiple pound signs. Further, due to the extremely volatile nature of htaccess voodoo, it is wise to include only alphanumeric characters (and perhaps a few dashes and underscores) in any .htaccess comments.&lt;br /&gt;&lt;br /&gt;Important Notes for .htaccess Noobs&lt;br /&gt;&lt;br /&gt;As a configuration file, .htaccess is very powerful. Even the slightest syntax error (like a missing space) can result in severe server malfunction. Thus it is crucial to make backup copies of everything related to your site (including any original .htaccess files) before working with your Hypertext Access file(s). It is also important to check your entire website thoroughly after making any changes to your .htaccess file. If any errors or other problems are encountered, employ your backups immediately to restore original functionality.&lt;br /&gt;&lt;br /&gt;Performance Issues&lt;br /&gt;&lt;br /&gt;.htaccess directives provide directory-level configuration without requiring access to Apache’s main server cofiguration file (httpd.conf). However, due to performance and security concerns, the main configuration file should always be used for server directives whenever possible. For example, when a server is configured to process .htaccess directives, Apache must search every directory within the domain and load any and all .htaccess files upon every document request. This results in increased page processing time and thus decreases performance. Such a performance hit may be unnoticeable for sites with light traffic, but becomes a more serious issue for more popular websites. Therefore, .htaccess files should only be used when the main server configuration file is inaccessible. See the “Performance Tricks” section of this article for more information.&lt;br /&gt;&lt;br /&gt;Regex Character Definitions for htaccess2&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;    the # instructs the server to ignore the line. used for including comments. each line of comments requires it’s own #. when including comments, it is good practice to use only letters, numbers, dashes, and underscores. this practice will help eliminate/avoid potential server parsing errors.&lt;br /&gt;[F]&lt;br /&gt;    Forbidden: instructs the server to return a 403 Forbidden to the client.&lt;br /&gt;[L]&lt;br /&gt;    Last rule: instructs the server to stop rewriting after the preceding directive is processed.&lt;br /&gt;[N]&lt;br /&gt;    Next: instructs Apache to rerun the rewrite rule until all rewriting directives have been achieved.&lt;br /&gt;[G]&lt;br /&gt;    Gone: instructs the server to deliver Gone (no longer exists) status message.&lt;br /&gt;[P]&lt;br /&gt;    Proxy: instructs server to handle requests by mod_proxy&lt;br /&gt;[C]&lt;br /&gt;    Chain: instructs server to chain the current rule with the previous rule.&lt;br /&gt;[R]&lt;br /&gt;    Redirect: instructs Apache to issue a redirect, causing the browser to request the rewritten/modified URL.&lt;br /&gt;[NC]&lt;br /&gt;    No Case: defines any associated argument as case-insensitive. i.e., "NC" = "No Case".&lt;br /&gt;[PT]&lt;br /&gt;    Pass Through: instructs mod_rewrite to pass the rewritten URL back to Apache for further processing.&lt;br /&gt;[OR]&lt;br /&gt;    Or: specifies a logical "or" that ties two expressions together such that either one proving true will cause the associated rule to be applied.&lt;br /&gt;[NE]&lt;br /&gt;    No Escape: instructs the server to parse output without escaping characters.&lt;br /&gt;[NS]&lt;br /&gt;    No Subrequest: instructs the server to skip the directive if internal sub-request.&lt;br /&gt;[QSA]&lt;br /&gt;    Append Query String: directs server to add the query string to the end of the expression (URL).&lt;br /&gt;[S=x]&lt;br /&gt;    Skip: instructs the server to skip the next "x" number of rules if a match is detected.&lt;br /&gt;[E=variable:value]&lt;br /&gt;    Environmental Variable: instructs the server to set the environmental variable "variable" to "value".&lt;br /&gt;[T=MIME-type]&lt;br /&gt;    Mime Type: declares the mime type of the target resource.&lt;br /&gt;[]&lt;br /&gt;    specifies a character class, in which any character within the brackets will be a match. e.g., [xyz] will match either an x, y, or z.&lt;br /&gt;[]+&lt;br /&gt;    character class in which any combination of items within the brackets will be a match. e.g., [xyz]+ will match any number of x’s, y’s, z’s, or any combination of these characters.&lt;br /&gt;[^]&lt;br /&gt;    specifies not within a character class. e.g., [^xyz] will match any character that is neither x, y, nor z.&lt;br /&gt;[a-z]&lt;br /&gt;    a dash (-) between two characters within a character class ([]) denotes the range of characters between them. e.g., [a-zA-Z] matches all lowercase and uppercase letters from a to z.&lt;br /&gt;a{n}&lt;br /&gt;    specifies an exact number, n, of the preceding character. e.g., x{3} matches exactly three x’s.&lt;br /&gt;a{n,}&lt;br /&gt;    specifies n or more of the preceding character. e.g., x{3,} matches three or more x’s.&lt;br /&gt;a{n,m}&lt;br /&gt;    specifies a range of numbers, between n and m, of the preceding character. e.g., x{3,7} matches three, four, five, six, or seven x’s.&lt;br /&gt;()&lt;br /&gt;    used to group characters together, thereby considering them as a single unit. e.g., (perishable)?press will match press, with or without the perishable prefix.&lt;br /&gt;^&lt;br /&gt;    denotes the beginning of a regex (regex = regular expression) test string. i.e., begin argument with the proceeding character.&lt;br /&gt;$&lt;br /&gt;    denotes the end of a regex (regex = regular expression) test string. i.e., end argument with the previous character.&lt;br /&gt;?&lt;br /&gt;    declares as optional the preceding character. e.g., monzas? will match monza or monzas, while mon(za)? will match either mon or monza. i.e., x? matches zero or one of x.&lt;br /&gt;!&lt;br /&gt;    declares negation. e.g., “!string” matches everything except “string”.&lt;br /&gt;.&lt;br /&gt;    a dot (or period) indicates any single arbitrary character.&lt;br /&gt;-&lt;br /&gt;    instructs “not to” rewrite the URL, as in “...domain.com.* - [F]”.&lt;br /&gt;+&lt;br /&gt;    matches one or more of the preceding character. e.g., G+ matches one or more G’s, while "+" will match one or more characters of any kind.&lt;br /&gt;*&lt;br /&gt;    matches zero or more of the preceding character. e.g., use “.*” as a wildcard.&lt;br /&gt;|&lt;br /&gt;    declares a logical “or” operator. for example, (x|y) matches x or y.&lt;br /&gt;\&lt;br /&gt;    escapes special characters ( ^ $ ! . * | ). e.g., use “\.” to indicate/escape a literal dot.&lt;br /&gt;\.&lt;br /&gt;    indicates a literal dot (escaped).&lt;br /&gt;/*&lt;br /&gt;    zero or more slashes.&lt;br /&gt;.*&lt;br /&gt;    zero or more arbitrary characters.&lt;br /&gt;^$&lt;br /&gt;    defines an empty string.&lt;br /&gt;^.*$&lt;br /&gt;    the standard pattern for matching everything.&lt;br /&gt;[^/.]&lt;br /&gt;    defines one character that is neither a slash nor a dot.&lt;br /&gt;[^/.]+&lt;br /&gt;    defines any number of characters which contains neither slash nor dot.&lt;br /&gt;http://&lt;br /&gt;    this is a literal statement — in this case, the literal character string, “http://”.&lt;br /&gt;^domain.*&lt;br /&gt;    defines a string that begins with the term “domain”, which then may be proceeded by any number of any characters.&lt;br /&gt;^domain\.com$&lt;br /&gt;    defines the exact string “domain.com”.&lt;br /&gt;-d&lt;br /&gt;    tests if string is an existing directory&lt;br /&gt;-f&lt;br /&gt;    tests if string is an existing file&lt;br /&gt;-s&lt;br /&gt;    tests if file in test string has a non-zero value&lt;br /&gt;&lt;br /&gt;Redirection Header Codes&lt;br /&gt;&lt;br /&gt;    * 301 - Moved Permanently&lt;br /&gt;    * 302 - Moved Temporarily&lt;br /&gt;    * 403 - Forbidden&lt;br /&gt;    * 404 - Not Found&lt;br /&gt;    * 410 - Gone&lt;br /&gt;&lt;br /&gt;Essentials&lt;br /&gt;&lt;br /&gt;Commenting your htaccess Files&lt;br /&gt;&lt;br /&gt;It is an excellent idea to consistenly and logically comment your htaccess files. Any line in an htaccess file that begins with the pound sign ( # ) tells the server to ignore it. Multiple lines require multiple pounds and use letters/numbers/dash/underscore only:&lt;br /&gt;&lt;br /&gt;# this is a comment&lt;br /&gt;# each line must have its own pound sign&lt;br /&gt;# use only alphanumeric characters along with dashes - and underscores _&lt;br /&gt;&lt;br /&gt;Enable Basic Rewriting&lt;br /&gt;&lt;br /&gt;Certain servers may not have “mod_rewrite” enabled by default. To ensure mod_rewrite (basic rewriting) is enabled throughout your site, add the following line once to your site’s root htaccess file:&lt;br /&gt;&lt;br /&gt;# enable basic rewriting&lt;br /&gt;RewriteEngine on&lt;br /&gt;&lt;br /&gt;Enable Symbolic Links&lt;br /&gt;&lt;br /&gt;Enable symbolic links (symlinks) by adding the following directive to the target directory’s htaccess file. Note: for the FollowSymLinks directive to function, AllowOverride Options privileges must be enabled from within the server configuration file (see proceeding paragraph for more information):&lt;br /&gt;&lt;br /&gt;# enable symbolic links&lt;br /&gt;Options +FollowSymLinks&lt;br /&gt;&lt;br /&gt;Enable AllowOverride&lt;br /&gt;&lt;br /&gt;For directives that require AllowOverride in order to function, such as FollowSymLinks (see above paragraph), the following directive must be added to the server configuration file. For performance considerations, it is important to only enable AllowOverride in the specific directory or directories in which it is required. In the following code chunk, we are enabling the AllowOverride privs only in the specified directory (/www/replace/this/with/actual/directory). Refer to this section for more information about AllowOverride and performance enhancement:&lt;br /&gt;&lt;br /&gt;# enable allowoverride privileges&lt;br /&gt;&lt;directory&gt;&lt;br /&gt; AllowOverride Options&lt;br /&gt;&lt;/directory&gt;&lt;br /&gt;&lt;br /&gt;Rename the htaccess File&lt;br /&gt;&lt;br /&gt;Not every system enjoys the extension-only format of htaccess files. Fortunately, you can rename them to whatever you wish, granted the name is valid on your system. Note: This directive must be placed in the server-wide configuration file or it will not work:&lt;br /&gt;&lt;br /&gt;# rename htaccess files&lt;br /&gt;AccessFileName ht.access&lt;br /&gt;&lt;br /&gt;Note: If you rename your htaccess files, remember to update any associated configuration settings. For example, if you are protecting your htaccess file via FilesMatch, remember to inform it of the renamed files:&lt;br /&gt;&lt;br /&gt;# protect renamed htaccess files&lt;br /&gt;&lt;filesmatch&gt;&lt;br /&gt; Order deny,allow&lt;br /&gt; Deny from all&lt;br /&gt;&lt;/filesmatch&gt;&lt;br /&gt;&lt;br /&gt;Retain Rules Defined in httpd.conf&lt;br /&gt;&lt;br /&gt;Save yourself time and effort by defining replicate rules for multiple virtual hosts once and only once via your httpd.conf file. Then, simply instruct your target htaccess file(s) to inheret the httpd.conf rules by including this directive:&lt;br /&gt;&lt;br /&gt;RewriteOptions Inherit&lt;br /&gt;Performance&lt;br /&gt;&lt;br /&gt;Improving Performance via AllowOverride&lt;br /&gt;&lt;br /&gt;Limit the extent to which htaccess files decrease performance by enabling AllowOverride only in required directories. For example, if AllowOverride is enabled throughout the entire site, the server must dig through every directory, searching for htaccess files that may not even exist. To prevent this, we disable the AllowOverride in the site’s root htaccess file and then enable AllowOverride only in required directories via the server config file (refer to this section for more information). Note: if you do not have access to your site’s server config file and also need AllowOverride privileges, do not use this directive:&lt;br /&gt;&lt;br /&gt;# increase performance by disabling allowoverride&lt;br /&gt;AllowOverride None&lt;br /&gt;&lt;br /&gt;Improving Performance by Passing the Character Set&lt;br /&gt;&lt;br /&gt;Prevent certain 500 error displays by passing the default character set parameter before you get there. Note: replace the “utf-8” below with the charset that your site is using:&lt;br /&gt;&lt;br /&gt;# pass the default character set&lt;br /&gt;AddDefaultCharset utf-8&lt;br /&gt;&lt;br /&gt;Improving Performance by Preserving Bandwidth&lt;br /&gt;&lt;br /&gt;To increase performance on PHP enabled servers, add the following directive:&lt;br /&gt;&lt;br /&gt;# preserve bandwidth for PHP enabled servers&lt;br /&gt;&lt;ifmodule&gt;&lt;br /&gt; php_value zlib.output_compression 16386&lt;br /&gt;&lt;/ifmodule&gt;&lt;br /&gt;&lt;br /&gt;Disable the Server Signature&lt;br /&gt;&lt;br /&gt;Here we are disabling the digital signature that would otherwise identify the server:&lt;br /&gt;&lt;br /&gt;# disable the server signature&lt;br /&gt;ServerSignature Off&lt;br /&gt;&lt;br /&gt;Set the Server Timezone&lt;br /&gt;&lt;br /&gt;Here we are instructing the server to synchronize chronologically according to the time zone of some specified state:&lt;br /&gt;&lt;br /&gt;# set the server timezone&lt;br /&gt;SetEnv TZ America/Washington&lt;br /&gt;&lt;br /&gt;Set the Email Address for the Server Administrator&lt;br /&gt;&lt;br /&gt;Here we are specifying the default email address for the server administrator:&lt;br /&gt;&lt;br /&gt;# set the server administrator email&lt;br /&gt;SetEnv SERVER_ADMIN default@domain.com&lt;br /&gt;&lt;br /&gt;Improve Site Transfer Speed by Enabling File Caching&lt;br /&gt;&lt;br /&gt;The htaccess genius over at askapache.com explains how to dramatically improve your site’s transfer speed by enabling file caching 3. Using time in seconds* to indicate the duration for which cached content should endure, we may generalize the htaccess rules as such (edit file types and time value to suit your needs):&lt;br /&gt;&lt;br /&gt;# cache images and flash content for one month&lt;br /&gt;&lt;filesmatch&gt;&lt;br /&gt;Header set Cache-Control "max-age=2592000"&lt;br /&gt;&lt;/filesmatch&gt;&lt;br /&gt;&lt;br /&gt;# cache text, css, and javascript files for one week&lt;br /&gt;&lt;filesmatch&gt;&lt;br /&gt;Header set Cache-Control "max-age=604800"&lt;br /&gt;&lt;/filesmatch&gt;&lt;br /&gt;&lt;br /&gt;# cache html and htm files for one day&lt;br /&gt;&lt;filesmatch&gt;&lt;br /&gt;Header set Cache-Control "max-age=43200"&lt;br /&gt;&lt;/filesmatch&gt;&lt;br /&gt;&lt;br /&gt;# implement minimal caching during site development&lt;br /&gt;&lt;filesmatch&gt;&lt;br /&gt;Header set Cache-Control "max-age=5"&lt;br /&gt;&lt;/filesmatch&gt;&lt;br /&gt;&lt;br /&gt;# explicitly disable caching for scripts and other dynamic files&lt;br /&gt;&lt;filesmatch&gt;&lt;br /&gt;Header unset Cache-Control&lt;br /&gt;&lt;/filesmatch&gt;&lt;br /&gt;&lt;br /&gt;# alternate method for file caching&lt;br /&gt;ExpiresActive On&lt;br /&gt;ExpiresDefault A604800 # 1 week&lt;br /&gt;ExpiresByType image/x-icon A2419200 # 1 month&lt;br /&gt;ExpiresByType application/x-javascript A2419200 # 1 month&lt;br /&gt;ExpiresByType text/css A2419200 # 1 month&lt;br /&gt;ExpiresByType text/html A300 # 5 minutes&lt;br /&gt;# disable caching for scripts and other dynamic files&lt;br /&gt;&lt;filesmatch&gt;&lt;br /&gt;ExpiresActive Off&lt;br /&gt;&lt;/filesmatch&gt;&lt;br /&gt;&lt;br /&gt;    * * Convert common time intervals into seconds:&lt;br /&gt;    * 300 = 5 minutes&lt;br /&gt;    * 2700 = 45 minutes&lt;br /&gt;    * 3600 = 1 hour&lt;br /&gt;    * 54000 = 15 hours&lt;br /&gt;    * 86400 = 1 day&lt;br /&gt;    * 518400 = 6 days&lt;br /&gt;    * 604800 = 1 week&lt;br /&gt;    * 1814400 = 3 weeks&lt;br /&gt;    * 2419200 = 1 month&lt;br /&gt;    * 26611200 = 11 months&lt;br /&gt;    * 29030400 = 1 year = never expires&lt;br /&gt;&lt;br /&gt;Set the default language and character set&lt;br /&gt;&lt;br /&gt;Here is an easy way to set the default language for pages served by your server (edit the language to suit your needs):&lt;br /&gt;&lt;br /&gt;# set the default language&lt;br /&gt;DefaultLanguage en-US&lt;br /&gt;&lt;br /&gt;Likewise, here we are setting the default character set (edit to taste):&lt;br /&gt;&lt;br /&gt;# set the default character set&lt;br /&gt;AddDefaultCharset UTF-8&lt;br /&gt;&lt;br /&gt;Declare specific/additional MIME types&lt;br /&gt;&lt;br /&gt;# add various mime types&lt;br /&gt;AddType application/x-shockwave-flash .swf&lt;br /&gt;AddType video/x-flv .flv&lt;br /&gt;AddType image/x-icon .ico&lt;br /&gt;&lt;br /&gt;Send character set and other headers without meta tags&lt;br /&gt;&lt;br /&gt;# send the language tag and default character set&lt;br /&gt;# AddType 'text/html; charset=UTF-8' html&lt;br /&gt;AddDefaultCharset UTF-8&lt;br /&gt;DefaultLanguage en-US&lt;br /&gt;&lt;br /&gt;Limit server request methods to GET and PUT&lt;br /&gt;&lt;br /&gt;# limit server request methods to GET and PUT&lt;br /&gt;Options -ExecCGI -Indexes -All&lt;br /&gt;RewriteEngine on&lt;br /&gt;RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK|OPTIONS|HEAD) RewriteRule .* - [F]&lt;br /&gt;&lt;br /&gt;Selectively process files according to server request method&lt;br /&gt;&lt;br /&gt;# process files according to server request method&lt;br /&gt;Script PUT /cgi-bin/upload.cgi&lt;br /&gt;Script GET /cgi-bin/download.cgi&lt;br /&gt;&lt;br /&gt;Execute various file types through a cgi script&lt;br /&gt;&lt;br /&gt;For those special occasions where certain file types need to be processed with some specific cgi script, let em know who sent ya:&lt;br /&gt;&lt;br /&gt;# execute all png files via png-script.cgi&lt;br /&gt;Action image/png /cgi-bin/png-script.cgi&lt;br /&gt;Security&lt;br /&gt;&lt;br /&gt;Prevent Acess to .htaccess&lt;br /&gt;&lt;br /&gt;Add the following code block to your htaccess file to add an extra layer of security. Any attempts to access the htaccess file will result in a 403 error message. Of course, your first layer of defense to protect htaccess files involves setting htaccess file permissions via CHMOD to 644:&lt;br /&gt;&lt;br /&gt;# secure htaccess file&lt;br /&gt;&lt;files&gt;&lt;br /&gt; order allow,deny&lt;br /&gt; deny from all&lt;br /&gt;&lt;/files&gt;&lt;br /&gt;&lt;br /&gt;Prevent Acess to a Specific File&lt;br /&gt;&lt;br /&gt;To restrict access to a specific file, add the following code block and edit the file name, “secretfile.jpg”, with the name of the file that you wish to protect:&lt;br /&gt;&lt;br /&gt;# prevent viewing of a specific file&lt;br /&gt;&lt;files&gt;&lt;br /&gt; order allow,deny&lt;br /&gt; deny from all&lt;br /&gt;&lt;/files&gt;&lt;br /&gt;&lt;br /&gt;Prevent acess to multiple file types&lt;br /&gt;&lt;br /&gt;To restrict access to a variety of file types, add the following code block and edit the file types within parentheses to match the extensions of any files that you wish to protect:&lt;br /&gt;&lt;br /&gt;&lt;filesmatch&gt;&lt;br /&gt; Order Allow,Deny&lt;br /&gt; Deny from all&lt;br /&gt;&lt;/filesmatch&gt;&lt;br /&gt;&lt;br /&gt;Prevent Unauthorized Directory Browsing&lt;br /&gt;&lt;br /&gt;Prevent unauthorized directory browsing by instructing the server to serve a “xxx Forbidden - Authorization Required” message for any request to view a directory. For example, if your site is missing it’s default index page, everything within the root of your site will be accessible to all visitors. To prevent this, include the following htaccess rule:&lt;br /&gt;&lt;br /&gt;# disable directory browsing&lt;br /&gt;Options All -Indexes&lt;br /&gt;&lt;br /&gt;Conversely, to enable directory browsing, use the following directive:&lt;br /&gt;&lt;br /&gt;# enable directory browsing&lt;br /&gt;Options All +Indexes&lt;br /&gt;&lt;br /&gt;Likewise, this rule will prevent the server from listing directory contents:&lt;br /&gt;&lt;br /&gt;# prevent folder listing&lt;br /&gt;IndexIgnore *&lt;br /&gt;&lt;br /&gt;And, finally, the IndexIgnore directive may be used to prevent the display of select file types:&lt;br /&gt;&lt;br /&gt;# prevent display of select file types&lt;br /&gt;IndexIgnore *.wmv *.mp4 *.avi *.etc&lt;br /&gt;&lt;br /&gt;Change Default Index Page&lt;br /&gt;&lt;br /&gt;This rule tells the server to search for and serve “business.html” as the default directory index. This rule must exist in the htaccess files of the root directory for which you wish to replace the default index file (e.g., “index.html”):&lt;br /&gt;&lt;br /&gt;# serve alternate default index page&lt;br /&gt;DirectoryIndex business.html&lt;br /&gt;&lt;br /&gt;This rule is similar, only in this case, the server will scan the root directory for the listed files and serve the first match it encounters. The list is read from left to right:&lt;br /&gt;&lt;br /&gt;# serve first available alternate default index page from series&lt;br /&gt;DirectoryIndex filename.html index.cgi index.pl default.htm&lt;br /&gt;&lt;br /&gt;Disguise Script Extensions&lt;br /&gt;&lt;br /&gt;To enhance security, disguise scripting languages by replacing actual script extensions with dummy extensions of your choosing. For example, to change the “.foo” extension to “.php”, add the following line to your htaccess file and rename all affected files accordingly:&lt;br /&gt;&lt;br /&gt;# serve foo files as php files&lt;br /&gt;AddType application/x-httpd-php .foo&lt;br /&gt;&lt;br /&gt;# serve foo files as cgi files&lt;br /&gt;AddType application/x-httpd-cgi .foo&lt;br /&gt;&lt;br /&gt;Limit Access to the Local Area Network (LAN)&lt;br /&gt;&lt;br /&gt;# limit access to local area network&lt;br /&gt;&lt;limit&gt;&lt;br /&gt; order deny,allow&lt;br /&gt; deny from all&lt;br /&gt; allow from 192.168.0.0/33&lt;br /&gt;&lt;/limit&gt;&lt;br /&gt;&lt;br /&gt;Secure Directories by IP Address and/or Domain&lt;br /&gt;&lt;br /&gt;In the following example, all IP addresses are allowed access except for 12.345.67.890 and domain.com:&lt;br /&gt;&lt;br /&gt;# allow all except those indicated here&lt;br /&gt;&lt;limit&gt;&lt;br /&gt; order allow,deny&lt;br /&gt; allow from all&lt;br /&gt; deny from 12.345.67.890&lt;br /&gt; deny from .*domain\.com.*&lt;br /&gt;&lt;/limit&gt;&lt;br /&gt;&lt;br /&gt;In the following example, all IP addresses are denied access except for 12.345.67.890 and domain.com:&lt;br /&gt;&lt;br /&gt;# deny all except those indicated here&lt;br /&gt;&lt;limit&gt;&lt;br /&gt; order deny,allow&lt;br /&gt; deny from all&lt;br /&gt; allow from 12.345.67.890&lt;br /&gt; allow from .*domain\.com.*&lt;br /&gt;&lt;/limit&gt;&lt;br /&gt;&lt;br /&gt;This is how to block unwanted visitors based on the referring domain. You can also save bandwidth by blocking specific file types — such as .jpg, .zip, .mp3, .mpg — from specific referring domains. Simply replace “scumbag” and “wormhole” with the offending domains of your choice:&lt;br /&gt;&lt;br /&gt;# block visitors referred from indicated domains&lt;br /&gt;&lt;ifmodule&gt;&lt;br /&gt; RewriteEngine on&lt;br /&gt; RewriteCond %{HTTP_REFERER} scumbag\.com [NC,OR]&lt;br /&gt; RewriteCond %{HTTP_REFERER} wormhole\.com [NC,OR]&lt;br /&gt; RewriteRule .* - [F]&lt;br /&gt;&lt;/ifmodule&gt;&lt;br /&gt;&lt;br /&gt;Prevent or allow domain access for a specified range of IP addresses&lt;br /&gt;&lt;br /&gt;There are several effective ways to block a range of IP addresses via htaccess. This first method blocks an IP range specified by thier CIDR (Classless Inter-Domain Routing) number. This method is useful for blocking mega-spammers such as RIPE, Optinet, and others. If, for example, you find yourself adding line after line of Apache deny directives for addresses beginning with the same first few numbers, choose one of them and try a whois lookup. Listed within the whois results will be the CIDR value representing every IP address associated with that particular network. Thus, blocking via CIDR is an effective way to eloquently prevent all IP instances of the offender from accessing your site. Here is a generalized example for blocking by CIDR (edit values to suit your needs):&lt;br /&gt;&lt;br /&gt;# block IP range by CIDR number&lt;br /&gt;&lt;limit&gt;&lt;br /&gt; order allow,deny&lt;br /&gt; allow from all&lt;br /&gt; deny from 10.1.0.0/16&lt;br /&gt; deny from 80.0.0/8&lt;br /&gt;&lt;/limit&gt;&lt;br /&gt;&lt;br /&gt;Likewise, to allow an IP range by CIDR number:&lt;br /&gt;&lt;br /&gt;# allow IP range by CIDR number&lt;br /&gt;&lt;limit&gt;&lt;br /&gt; order deny,allow&lt;br /&gt; deny from all&lt;br /&gt; allow from 10.1.0.0/16&lt;br /&gt; allow from 80.0.0/8&lt;br /&gt;&lt;/limit&gt;&lt;br /&gt;&lt;br /&gt;Another effective way to block an entire range of IP addresses involves truncating digits until the desired range is represented. As an IP address is read from left to right, its value represents an increasingly specific address. For example, a fictitious IP address of 99.88.77.66 would designate some uniquely specific IP address. Now, if we remove the last two digits (66) from the address, it would represent any address beginning with the remaining digits. That is, 99.88.77 represents 99.88.77.1, 99.88.77.2, … 99.88.77.99, …etc. Likewise, if we then remove another pair of digits from the address, its range suddenly widens to represent every IP address 99.88.x.y, where x and y represent any valid set of IP address values (i.e., you would block 256*256 = 65,536 unique IP addresses). Following this logic, it is possible to block an entire range of IP addresses to varying degrees of specificity. Here are few generalized lines exemplifying proper htaccess syntax (edit values to suit your needs):&lt;br /&gt;&lt;br /&gt;# block IP range by address truncation&lt;br /&gt;&lt;limit&gt;&lt;br /&gt; order allow,deny&lt;br /&gt; allow from all&lt;br /&gt; deny from 99.88.77.66&lt;br /&gt; deny from 99.88.77.*&lt;br /&gt; deny from 99.88.*.*&lt;br /&gt; deny from 99.*.*.*&lt;br /&gt;&lt;/limit&gt;&lt;br /&gt;&lt;br /&gt;Likewise, to allow an IP range by address truncation:&lt;br /&gt;&lt;br /&gt;# allow IP range by address truncation&lt;br /&gt;&lt;limit&gt;&lt;br /&gt; order deny,allow&lt;br /&gt; deny from all&lt;br /&gt; allow from 99.88.77.66&lt;br /&gt; allow from 99.88.77.*&lt;br /&gt; allow from 99.88.*.*&lt;br /&gt; allow from 99.*.*.*&lt;br /&gt;&lt;/limit&gt;&lt;br /&gt;&lt;br /&gt;Block or allow multiple IP addresses on one line&lt;br /&gt;&lt;br /&gt;Save a little space by blocking multiple IP addresses or ranges on one line. Here are few examples (edit values to suit your needs):&lt;br /&gt;&lt;br /&gt;# block two unique IP addresses&lt;br /&gt;deny from 99.88.77.66 11.22.33.44&lt;br /&gt;# block three ranges of IP addresses&lt;br /&gt;deny from 99.88 99.88.77 11.22.33&lt;br /&gt;&lt;br /&gt;Likewise, to allow multiple IP addresses or ranges on one line:&lt;br /&gt;&lt;br /&gt;# allow two unique IP addresses&lt;br /&gt;allow from 99.88.77.66 11.22.33.44&lt;br /&gt;# allow three ranges of IP addresses&lt;br /&gt;allow from 99.88 99.88.77 11.22.33&lt;br /&gt;&lt;br /&gt;Miscellaneous rules for blocking and allowing IP addresses&lt;br /&gt;&lt;br /&gt;Here are few miscellaneous rules for blocking various types of IP addresses. These rules may be adapted to allow the specified IP values by simply changing the deny directive to allow. Check ’em out (edit values to suit your needs):&lt;br /&gt;&lt;br /&gt;# block a partial domain via network/netmask values&lt;br /&gt;deny from 99.1.0.0/255.255.0.0&lt;br /&gt;&lt;br /&gt;# block a single domain&lt;br /&gt;deny from 99.88.77.66&lt;br /&gt;&lt;br /&gt;# block domain.com but allow sub.domain.com&lt;br /&gt;order deny,allow&lt;br /&gt;deny from domain.com&lt;br /&gt;allow from sub.domain.com&lt;br /&gt;&lt;br /&gt;Stop Hotlinking, Serve Alternate Content&lt;br /&gt;&lt;br /&gt;To serve ‘em some unexpected alternate content when hotlinking is detected, employ the following code, which will protect all files of the types included in the last line (add more types as needed). Remember to replace the dummy path names with real ones. Also, the name of the nasty image being served in this case is “eatme.jpe”, as indicated in the line containing the RewriteRule. Please advise that this method will also block services such as FeedBurner from accessing your images.&lt;br /&gt;&lt;br /&gt;# stop hotlinking and serve alternate content&lt;br /&gt;&lt;ifmodule&gt;&lt;br /&gt; RewriteEngine on&lt;br /&gt; RewriteCond %{HTTP_REFERER} !^$&lt;br /&gt; RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain\.com/.*$ [NC]&lt;br /&gt; RewriteRule .*\.(gif|jpg)$ http://www.domain.com/eatme.jpe [R,NC,L]&lt;br /&gt;&lt;/ifmodule&gt;&lt;br /&gt;&lt;br /&gt;Note: To deliver a standard (or custom, if configured) error page instead of some nasty image of the Fonz, replace the line containing the RewriteRule in the above htaccess directive with the following line:&lt;br /&gt;&lt;br /&gt;# serve a standard 403 forbidden error page&lt;br /&gt;RewriteRule .*\.(gif|jpg)$ - [F,L]&lt;br /&gt;&lt;br /&gt;Note: To grant linking permission to a site other than yours, insert this code block after the line containing the “domain.com” string. Remember to replace “goodsite.com” with the actual site domain:&lt;br /&gt;&lt;br /&gt;# allow linking from the following site&lt;br /&gt;RewriteCond %{HTTP_REFERER} !^http://(www\.)?goodsite\.com/.*$ [NC]&lt;br /&gt;&lt;br /&gt;Block Evil Robots, Site Rippers, and Offline Browsers&lt;br /&gt;&lt;br /&gt;Eliminate some of the unwanted scum from your userspace by injecting this handy block of code. After such, any listed agents will be denied access and receive an error message instead. Please advise that there are much more comprehensive lists available this example has been truncated for business purposes. Note: DO NOT include the “[OR]” on the very last RewriteCond or your server will crash, delivering “500 Errors” to all page requests.&lt;br /&gt;&lt;br /&gt;# deny access to evil robots site rippers offline browsers and other nasty scum&lt;br /&gt;RewriteBase /&lt;br /&gt;RewriteCond %{HTTP_USER_AGENT} ^Anarchie [OR]&lt;br /&gt;RewriteCond %{HTTP_USER_AGENT} ^ASPSeek [OR]&lt;br /&gt;RewriteCond %{HTTP_USER_AGENT} ^attach [OR]&lt;br /&gt;RewriteCond %{HTTP_USER_AGENT} ^autoemailspider [OR]&lt;br /&gt;RewriteCond %{HTTP_USER_AGENT} ^Xaldon\ WebSpider [OR]&lt;br /&gt;RewriteCond %{HTTP_USER_AGENT} ^Xenu [OR]&lt;br /&gt;RewriteCond %{HTTP_USER_AGENT} ^Zeus.*Webster [OR]&lt;br /&gt;RewriteCond %{HTTP_USER_AGENT} ^Zeus&lt;br /&gt;RewriteRule ^.* - [F,L]&lt;br /&gt;&lt;br /&gt;Or, instead of delivering a friendly error message (i.e., the last line), send these bad boys to the hellish website of your choice by replacing the RewriteRule in the last line with one of the following two examples:&lt;br /&gt;&lt;br /&gt;# send em to a hellish website of your choice&lt;br /&gt;RewriteRule ^.*$ http://www.hellish-website.com [R,L]&lt;br /&gt;&lt;br /&gt;Or, to send em to a virtual blackhole of fake email addresses:&lt;br /&gt;&lt;br /&gt;# send em to a virtual blackhole of fake email addresses&lt;br /&gt;RewriteRule ^.*$ http://english-61925045732.spampoison.com [R,L]&lt;br /&gt;&lt;br /&gt;You may also include specific referrers to your blacklist by using HTTP_REFERER. Here, we use the infamously scummy domain, “iaea.org” as our blocked example, and we use “yourdomain” as your domain (the domain to which you are blocking iaea.org):&lt;br /&gt;&lt;br /&gt;RewriteCond %{HTTP_REFERER} ^http://www.iaea.org$&lt;br /&gt;RewriteRule !^http://[^/.]\.yourdomain\.com.* - [F,L]&lt;br /&gt;&lt;br /&gt;More Stupid Blocking Tricks&lt;br /&gt;&lt;br /&gt;Note: Although these redirect techniques are aimed at blocking and redirecting nasty scumsites, the directives may also be employed for friendly redirection purposes:&lt;br /&gt;&lt;br /&gt;# redirect any request for anything from spamsite to differentspamsite&lt;br /&gt;RewriteCond %{HTTP_REFERER} ^http://.*spamsite.*$ [NC]&lt;br /&gt;RewriteRule .* http://www.differentspamsite.com [R]&lt;br /&gt;&lt;br /&gt;# redirect all requests from spamsite to an image of something at differentspamsite&lt;br /&gt;RewriteCond %{HTTP_REFERER} ^http://.*spamsite.*$ [NC]&lt;br /&gt;RewriteRule .* http://www.differentspamsite/something.jpg [R]&lt;br /&gt;&lt;br /&gt;# redirect traffic from a certain address or range of addresses to another site&lt;br /&gt;RewriteCond %{REMOTE_ADDR} 192.168.10.*&lt;br /&gt;RewriteRule .* http://www.differentspamsite.com/index.html [R]&lt;br /&gt;&lt;br /&gt;Even More Scum-Blocking Tricks&lt;br /&gt;&lt;br /&gt;Here is a step-by-step series of code blocks that should equip you with enough knowledge to block any/all necessary entities. Read through the set of code blocks, observe the patterns, and then copy, combine and customize to suit your specific scum-blocking needs:&lt;br /&gt;&lt;br /&gt;# set variables for user agents and referers and ip addresses&lt;br /&gt;SetEnvIfNoCase User-Agent ".*(user-agent-you-want-to-block|php/perl).*" BlockedAgent&lt;br /&gt;SetEnvIfNoCase Referer ".*(block-this-referrer|and-this-referrer|and-this-referrer).*" BlockedReferer&lt;br /&gt;SetEnvIfNoCase REMOTE_ADDR ".*(666.666.66.0|22.22.22.222|999.999.99.999).*" BlockedAddress&lt;br /&gt;&lt;br /&gt;# set variable for any class B network coming from a given netblock&lt;br /&gt;SetEnvIfNoCase REMOTE_ADDR "66.154.*" BlockedAddress&lt;br /&gt;&lt;br /&gt;# set variable for two class B networks 198.25.0.0 and 198.26.0.0&lt;br /&gt;SetEnvIfNoCase REMOTE_ADDR "198.2(5|6)\..*" BlockedAddress&lt;br /&gt;&lt;br /&gt;# deny any matches from above and send a 403 denied&lt;br /&gt;&lt;limit&gt;&lt;br /&gt; order deny,allow&lt;br /&gt; deny from env=BlockedAgent&lt;br /&gt; deny from env=BlockedReferer&lt;br /&gt; deny from env=BlockedAddress&lt;br /&gt; allow from all&lt;br /&gt;&lt;/limit&gt;&lt;br /&gt;&lt;br /&gt;Password-Protect Directories&lt;br /&gt;&lt;br /&gt;Here is an excellent online tool for generating the necessary elements for a password-protected directory:&lt;br /&gt;&lt;br /&gt;# password protect directories&lt;br /&gt;htaccess Password Generator&lt;br /&gt;&lt;br /&gt;Password-protect Files, Directories, and More..&lt;br /&gt;&lt;br /&gt;Secure site contents by requiring user authentication for specified files and/or directories. The first example shows how to password-protect any single file type that is present beneath the directory which houses the htaccess rule. The second rule employs the FilesMatch directive to protect any/all files which match any of the specified character strings. The third rule demonstrates how to protect an entire directory. The fourth set of rules provides password-protection for all IP’s except those specified. Remember to edit these rules according to your specific needs.&lt;br /&gt;&lt;br /&gt;# password-protect single file&lt;br /&gt;&lt;files&gt;&lt;br /&gt;AuthType Basic&lt;br /&gt;AuthName "Prompt"&lt;br /&gt;AuthUserFile /home/path/.htpasswd&lt;br /&gt;Require valid-user&lt;br /&gt;&lt;/files&gt;&lt;br /&gt;&lt;br /&gt;# password-protect multiple files&lt;br /&gt;&lt;filesmatch&gt;&lt;br /&gt;AuthType basic&lt;br /&gt;AuthName "Development"&lt;br /&gt;AuthUserFile /home/path/.htpasswd&lt;br /&gt;Require valid-user&lt;br /&gt;&lt;/filesmatch&gt;&lt;br /&gt;&lt;br /&gt;# password-protect the directory in which this htaccess rule resides&lt;br /&gt;AuthType basic&lt;br /&gt;AuthName "This directory is protected"&lt;br /&gt;AuthUserFile /home/path/.htpasswd&lt;br /&gt;AuthGroupFile /dev/null&lt;br /&gt;Require valid-user&lt;br /&gt;&lt;br /&gt;# password-protect directory for every IP except the one specified&lt;br /&gt;# place in htaccess file of a directory to protect that entire directory&lt;br /&gt;AuthType Basic&lt;br /&gt;AuthName "Personal"&lt;br /&gt;AuthUserFile /home/path/.htpasswd&lt;br /&gt;Require valid-user&lt;br /&gt;Allow from 99.88.77.66&lt;br /&gt;Satisfy Any&lt;br /&gt;&lt;br /&gt;Require SSL (Secure Sockets Layer)&lt;br /&gt;&lt;br /&gt;Here is an excellent method for requiring SSL (via askapache.com 3):&lt;br /&gt;&lt;br /&gt;# require SSL&lt;br /&gt;SSLOptions +StrictRequire&lt;br /&gt;SSLRequireSSL&lt;br /&gt;SSLRequire %{HTTP_HOST} eq "domain.tld"&lt;br /&gt;ErrorDocument 403 https://domain.tld&lt;br /&gt;&lt;br /&gt;# require SSL without mod_ssl&lt;br /&gt;RewriteCond %{HTTPS} !=on [NC]&lt;br /&gt;RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]&lt;br /&gt;&lt;br /&gt;Automatically CHMOD Various File Types&lt;br /&gt;&lt;br /&gt;This method is great for ensuring the CHMOD settings for various file types. Employ the following rules in the root htaccess file to affect all specified file types, or place in a specific directory to affect only those files (edit file types according to your needs):&lt;br /&gt;&lt;br /&gt;# ensure CHMOD settings for specified file types&lt;br /&gt;# remember to never set CHMOD 777 unless you know what you are doing&lt;br /&gt;# files requiring write access should use CHMOD 766 rather than 777&lt;br /&gt;# keep specific file types private by setting their CHMOD to 400&lt;br /&gt;chmod .htpasswd files 640&lt;br /&gt;chmod .htaccess files 644&lt;br /&gt;chmod php files 600&lt;br /&gt;&lt;br /&gt;Disguise all file extensions&lt;br /&gt;&lt;br /&gt;This method will disguise all file types (i.e., any file extension) and present them as .php files (or whichever extension you choose):&lt;br /&gt;&lt;br /&gt;# diguise all file extensions as php&lt;br /&gt;ForceType application/x-httpd-php&lt;br /&gt;&lt;br /&gt;Protect against denial-of-service (DOS) attacks by limiting file upload size&lt;br /&gt;&lt;br /&gt;One method to help protect your server against DOS attacks involves limiting the maximum allowable size for file uploads. Here, we are limiting file upload size to 10240000 bytes, which is equivalent to around 10 megabytes. For this rule, file sizes are expressed in bytes. Check here for help with various file size conversions. Note: this code is only useful if you actually allow users to upload files to your site.&lt;br /&gt;&lt;br /&gt;# protect against DOS attacks by limiting file upload size&lt;br /&gt;LimitRequestBody 10240000&lt;br /&gt;&lt;br /&gt;Secure directories by disabling execution of scripts&lt;br /&gt;&lt;br /&gt;Prevent malicious brainiacs from actively scripting secure directories by adding the following rules to the representative htaccess file (edit file types to suit your needs):&lt;br /&gt;&lt;br /&gt;# secure directory by disabling script execution&lt;br /&gt;AddHandler cgi-script .php .pl .py .jsp .asp .htm .shtml .sh .cgi&lt;br /&gt;Options -ExecCGI&lt;br /&gt;Usability Tricks&lt;br /&gt;&lt;br /&gt;Minimize CSS Image Flicker in IE6&lt;br /&gt;&lt;br /&gt;Add the following htaccess rules to minimize or even eliminate CSS background-image “flickering” in MSIE6:&lt;br /&gt;&lt;br /&gt;# minimize image flicker in IE6&lt;br /&gt;ExpiresActive On&lt;br /&gt;ExpiresByType image/gif A2592000&lt;br /&gt;ExpiresByType image/jpg A2592000&lt;br /&gt;ExpiresByType image/png A2592000&lt;br /&gt;&lt;br /&gt;Deploy Custom Error Pages&lt;br /&gt;&lt;br /&gt;Replicate the following patterns to serve your own set of custom error pages. Simply replace the “/errors/###.html” with the correct path and file name. Also change the “###” preceding the path to summon pages for other errors. Note: your custom error pages must be larger than 512 bytes in size or they will be completely ignored by Internet Explorer:&lt;br /&gt;&lt;br /&gt;# serve custom error pages&lt;br /&gt;ErrorDocument 400 /errors/400.html&lt;br /&gt;ErrorDocument 401 /errors/401.html&lt;br /&gt;ErrorDocument 403 /errors/403.html&lt;br /&gt;ErrorDocument 404 /errors/404.html&lt;br /&gt;ErrorDocument 500 /errors/500.html&lt;br /&gt;&lt;br /&gt;Provide a Universal Error Document&lt;br /&gt;&lt;br /&gt;# provide a universal error document&lt;br /&gt;RewriteCond %{REQUEST_FILENAME} !-f&lt;br /&gt;RewriteCond %{REQUEST_FILENAME} !-d&lt;br /&gt;RewriteRule ^.*$ /dir/error.php [L]&lt;br /&gt;&lt;br /&gt;Employ Basic URL Spelling Check&lt;br /&gt;&lt;br /&gt;This bit of voodoo will auto-correct simple spelling errors in the URL:&lt;br /&gt;&lt;br /&gt;# automatically corect simple speling erors&lt;br /&gt;&lt;ifmodule&gt;&lt;br /&gt; CheckSpelling On&lt;br /&gt;&lt;/ifmodule&gt;&lt;br /&gt;&lt;br /&gt;Instruct browser to download multimedia files rather than display them&lt;br /&gt;&lt;br /&gt;Here is a useful method for delivering multimedia file downloads to your users. Typically, browsers will attempt to play or stream such files when direct links are clicked. With this method, provide a link to a multimedia file and a dialogue box will provide users the choice of saving the file or opening it. Here are a few htaccess rules demonstrating the technique (edit file types according to your specific needs):&lt;br /&gt;&lt;br /&gt;# instruct browser to download multimedia files&lt;br /&gt;AddType application/octet-stream .avi&lt;br /&gt;AddType application/octet-stream .mpg&lt;br /&gt;AddType application/octet-stream .wmv&lt;br /&gt;AddType application/octet-stream .mp3&lt;br /&gt;&lt;br /&gt;Instruct server to display source code for dynamic file types&lt;br /&gt;&lt;br /&gt;There are many situations where site owners may wish to display the contents of a dynamic file rather than executing it as a script. To exercise this useful technique, create a directory in which to place dynamic files that should be displayed rather than executed, and add the following line of code to the htaccess file belonging to that directory. This method is known to work for .pl, .py, and .cgi file-types. Here it is:&lt;br /&gt;&lt;br /&gt;RemoveHandler cgi-script .pl .py .cgi&lt;br /&gt;&lt;br /&gt;Redirect visitors to a temporary site during site development&lt;br /&gt;&lt;br /&gt;During web development, maintenance, or repair, send your visitors to an alternate site while retaining full access for yourself. This is a very useful technique for preventing visitor confusion or dismay during those awkward, web-development moments. Here are the generalized htaccess rules to do it (edit values to suit your needs):&lt;br /&gt;&lt;br /&gt;# redirect all visitors to alternate site but retain full access for you&lt;br /&gt;ErrorDocument 403 http://www.alternate-site.com&lt;br /&gt;Order deny,allow&lt;br /&gt;Deny from all&lt;br /&gt;Allow from 99.88.77.66&lt;br /&gt;&lt;br /&gt;Provide a password prompt for visitors during site development&lt;br /&gt;&lt;br /&gt;Here is another possible solution for "hiding" your site during those private, site-under-construction moments. Here we are instructing Apache to provide visitors with a password prompt while providing open access to any specifically indicated IP addresses or URL’s. Edit the following code according to your IP address and other development requirements (thanks to Caleb at askapache.com for sharing this trick 3):&lt;br /&gt;&lt;br /&gt;# password prompt for visitors&lt;br /&gt;AuthType basic&lt;br /&gt;AuthName "This site is currently under construction"&lt;br /&gt;AuthUserFile /home/path/.htpasswd&lt;br /&gt;AuthGroupFile /dev/null&lt;br /&gt;Require valid-user&lt;br /&gt;# allow webmaster and any others open access&lt;br /&gt;Order Deny,Allow&lt;br /&gt;Deny from all&lt;br /&gt;Allow from 111.222.33.4&lt;br /&gt;Allow from favorite.validation/services/&lt;br /&gt;Allow from googlebot.com&lt;br /&gt;Satisfy Any&lt;br /&gt;&lt;br /&gt;Prevent file or directory access according to specified time periods&lt;br /&gt;&lt;br /&gt;Prevent viewing of all pictures of Fonzi during the midnight hour — or any files during any time period — by using this handy htaccess ruleset:&lt;br /&gt;&lt;br /&gt;# prevent access during the midnight hour&lt;br /&gt;RewriteCond %{TIME_HOUR} ^12$&lt;br /&gt;RewriteRule ^.*$ - [F,L]&lt;br /&gt;&lt;br /&gt;# prevent access throughout the afternoon&lt;br /&gt;RewriteCond %{TIME_HOUR} ^(12|13|14|15)$&lt;br /&gt;RewriteRule ^.*$ - [F,L]&lt;br /&gt;Redirect Tricks&lt;br /&gt;&lt;br /&gt;Important Note About Redirecting via mod_rewrite&lt;br /&gt;&lt;br /&gt;For all redirects using the mod_rewrite directive, it is necessary to have the RewriteEngine enabled. It is common practice to enable the mod_rewrite directive in either the server configuration file or at the top of the site’s root htaccess file. If the mod_rewrite directive is not included in either of these two places, it should be included as the first line in any code block that utilizes a rewrite function (i.e., mod_rewrite), but only needs to be included once for each htaccess file. The proper mod_rewrite directive is included here for your convenience, but may or may not also be included within some of the code blocks provided in this article:&lt;br /&gt;&lt;br /&gt;# initialize and enable rewrite engine&lt;br /&gt;RewriteEngine on&lt;br /&gt;&lt;br /&gt;Redirect from http://www.domain.com to http://domain.com&lt;br /&gt;&lt;br /&gt;This method uses a “301 redirect” to establish a permanent redirect from the “www-version” of a domain to its respectively corresponding “non-www version”. Be sure to test immediately after preparing 301 redirects and remove it immediately if any errors occur. Use a “server header checker” to confirm a positive 301 response. Further, always include a trailing slash “/” when linking directories. Finally, be consistent with the “www” in all links (either use it always or never).&lt;br /&gt;&lt;br /&gt;# permanently redirect from www domain to non-www domain&lt;br /&gt;RewriteEngine on&lt;br /&gt;Options +FollowSymLinks&lt;br /&gt;RewriteCond %{HTTP_HOST} ^www\.domain\.tld$ [NC]&lt;br /&gt;RewriteRule ^(.*)$ http://domain.tld/$1 [R=301,L]&lt;br /&gt;&lt;br /&gt;Redirect from http://old-domain.com to http://new-domain.com&lt;br /&gt;&lt;br /&gt;For a basic domain change from “old-domain.com” to “new-domain.com” (and folder/file names have not been changed), use the Rewrite rule to remap the old domain to the new domain. When checking the redirect live, the old domain may appear in the browser’s address bar. Simply check an image path (right-click an image and select “properties”) to verify proper redirection. Remember to check your site thoroughly after implementing this redirect.&lt;br /&gt;&lt;br /&gt;# redirect from old domain to new domain&lt;br /&gt;RewriteEngine On&lt;br /&gt;RewriteRule ^(.*)$ http://www.new-domain.com/$1 [R=301,L]&lt;br /&gt;&lt;br /&gt;Redirect String Variations to a Specific Address&lt;br /&gt;&lt;br /&gt;For example, if we wanted to redirect any requests containing the character string, “perish”, to our main page at http://perishablepress.com/, we would replace “some-string” with “perish” in the following code block:&lt;br /&gt;&lt;br /&gt;# redirect any variations of a specific character string to a specific address&lt;br /&gt;RewriteRule ^some-string http://www.domain.com/index.php/blog/target [R]&lt;br /&gt;&lt;br /&gt;Here are two other methods for accomplishing string-related mapping tasks:&lt;br /&gt;&lt;br /&gt;# map URL variations to the same directory on the same server&lt;br /&gt;AliasMatch ^/director(y|ies) /www/docs/target&lt;br /&gt;&lt;br /&gt;# map URL variations to the same directory on a different server&lt;br /&gt;RedirectMatch ^/[dD]irector(y|ies) http://domain.com&lt;br /&gt;&lt;br /&gt;Other Fantastic Redirect Tricks&lt;br /&gt;&lt;br /&gt;Redirect an entire site via 301:&lt;br /&gt;&lt;br /&gt;# redirect an entire site via 301&lt;br /&gt;redirect 301 / http://www.domain.com/&lt;br /&gt;&lt;br /&gt;Redirect a specific file via 301:&lt;br /&gt;&lt;br /&gt;# redirect a specific file via 301&lt;br /&gt;redirect 301 /current/currentfile.html http://www.newdomain.com/new/newfile.html&lt;br /&gt;&lt;br /&gt;Redirect an entire site via permanent redirect:&lt;br /&gt;&lt;br /&gt;# redirect an entire site via permanent redirect&lt;br /&gt;Redirect permanent / http://www.domain.com/&lt;br /&gt;&lt;br /&gt;Redirect a page or directory via permanent redirect:&lt;br /&gt;&lt;br /&gt;# redirect a page or directory&lt;br /&gt;Redirect permanent old_file.html http://www.new-domain.com/new_file.html&lt;br /&gt;Redirect permanent /old_directory/ http://www.new-domain.com/new_directory/&lt;br /&gt;&lt;br /&gt;Redirect a file using RedirectMatch:&lt;br /&gt;&lt;br /&gt;# redirect a file using RedirectMatch&lt;br /&gt;RedirectMatch 301 ^.*$ http://www.domain.com/index.html&lt;br /&gt;&lt;br /&gt;Note: When redirecting specific files, use Apache‘s Redirect rule for files within the same domain. Use Apache‘s RewriteRule for any domains, especially if they are different. The RewriteRule is more powerful than the Redirect rule, and thus should serve you more effectively.&lt;br /&gt;&lt;br /&gt;Thus, use the following for a stronger, harder page redirection (first line redirects a file, second line a directory, and third a domain):&lt;br /&gt;&lt;br /&gt;# redirect files directories and domains via RewriteRule&lt;br /&gt;RewriteRule http://old-domain.com/old-file.html http://new-domain.com/new-file.html&lt;br /&gt;RewriteRule http://old-domain.com/old-dir/ http://new-domain.com/new-dir/&lt;br /&gt;RewriteRule http://old-domain.com/ http://new-domain.com/&lt;br /&gt;&lt;br /&gt;Send visitors to a subdomain&lt;br /&gt;&lt;br /&gt;This rule will ensure that all visitors are viewing pages via the subdomain of your choice. Edit the "subdomain", "domain", and "tld" to match your subdomain, domain, and top-level domain respectively:&lt;br /&gt;&lt;br /&gt;# send visitors to a subdomain&lt;br /&gt;RewriteCond %{HTTP_HOST} !^$&lt;br /&gt;RewriteCond %{HTTP_HOST} !^subdomain\.domain\.com$ [NC]&lt;br /&gt;RewriteRule ^/(.*)$ http://subdomain.domain.tld/$1 [L,R=301]&lt;br /&gt;&lt;br /&gt;More fun with RewriteCond and RewriteRule&lt;br /&gt;&lt;br /&gt;# rewrite only if the file is not found&lt;br /&gt;RewriteCond %{REQUEST_FILENAME} !-f&lt;br /&gt;RewriteRule ^(.+)special\.html?$ cgi-bin/special/special-html/$1&lt;br /&gt;&lt;br /&gt;# rewrite only if an image is not found&lt;br /&gt;RewriteCond %{REQUEST_FILENAME} !-f&lt;br /&gt;RewriteRule images/special/(.*).gif cgi-bin/special/mkgif?$1&lt;br /&gt;&lt;br /&gt;# seo-friendly rewrite rules for various directories&lt;br /&gt;RewriteRule ^(.*)/aud/(.*)$ $1/audio-files/$2 [L,R=301]&lt;br /&gt;RewriteRule ^(.*)/img/(.*)$ $1/image-files/$2 [L,R=301]&lt;br /&gt;RewriteRule ^(.*)/fla/(.*)$ $1/flash-files/$2 [L,R=301]&lt;br /&gt;RewriteRule ^(.*)/vid/(.*)$ $1/video-files/$2 [L,R=301]&lt;br /&gt;&lt;br /&gt;# broswer sniffing via htaccess environmental variables&lt;br /&gt;RewriteCond %{HTTP_USER_AGENT} ^Mozilla.*&lt;br /&gt;RewriteRule ^/$ /index-for-mozilla.html [L]&lt;br /&gt;RewriteCond %{HTTP_USER_AGENT} ^Lynx.*&lt;br /&gt;RewriteRule ^/$ /index-for-lynx.html [L]&lt;br /&gt;RewriteRule ^/$ /index-for-all-others.html [L]&lt;br /&gt;&lt;br /&gt;# redirect query to Google search&lt;br /&gt;Options +FollowSymlinks&lt;br /&gt;RewriteEngine On&lt;br /&gt;RewriteCond %{REQUEST_URI} .google\.php*&lt;br /&gt;RewriteRule ^(.*)$ ^http://www.google.com/search?q=$1 [R,NC,L]&lt;br /&gt;&lt;br /&gt;# deny request according to the request method&lt;br /&gt;RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK|OPTIONS|HEAD)$ [NC]&lt;br /&gt;RewriteRule ^.*$ - [F]&lt;br /&gt;&lt;br /&gt;# redirect uploads to a better place&lt;br /&gt;RewriteCond %{REQUEST_METHOD} ^(PUT|POST)$ [NC]&lt;br /&gt;RewriteRule ^(.*)$ /cgi-bin/upload-processor.cgi?p=$1 [L,QSA]&lt;br /&gt;&lt;br /&gt;More fun with Redirect 301 and RedirectMatch 301&lt;br /&gt;&lt;br /&gt;# seo friendly redirect for a single file&lt;br /&gt;Redirect 301 /old-dir/old-file.html http://domain.com/new-dir/new-file.html&lt;br /&gt;&lt;br /&gt;# seo friendly redirect for multiple files&lt;br /&gt;# redirects all files in dir directory with first letters xyz&lt;br /&gt;RedirectMatch 301 /dir/xyz(.*) http://domain.com/$1&lt;br /&gt;&lt;br /&gt;# seo friendly redirect entire site to a different domain&lt;br /&gt;Redirect 301 / http://different-domain.com&lt;br /&gt;WordPress Tricks&lt;br /&gt;&lt;br /&gt;Secure WordPress Contact Forms&lt;br /&gt;&lt;br /&gt;Protect your insecure WordPress contact forms against online unrighteousness by verifying the domain from whence the form is called. Remember to replace the “domain.com” and “contact.php” with your domain and contact-form file names, respectively.&lt;br /&gt;&lt;br /&gt;# secure wordpress contact forms via referrer check&lt;br /&gt;RewriteCond %{HTTP_REFERER} !^http://www.domain.com/.*$ [NC]&lt;br /&gt;RewriteCond %{REQUEST_POST} .*contact.php$&lt;br /&gt;RewriteRule .* - [F]&lt;br /&gt;&lt;br /&gt;WordPress Permalinks&lt;br /&gt;&lt;br /&gt;In our article, The htaccess rules for all WordPress Permalinks, we revealed the precise htaccess directives used by the WordPress blogging platform for permalink functionality. Here, for the sake of completeness, we repeat the directives only. For more details please refer to the original article:&lt;br /&gt;&lt;br /&gt;If WordPress is installed in the site’s root directory, WordPress creates and uses the following htaccess directives:&lt;br /&gt;&lt;br /&gt;# BEGIN WordPress&lt;br /&gt;&lt;ifmodule&gt;&lt;br /&gt; RewriteEngine On&lt;br /&gt; RewriteBase /&lt;br /&gt; RewriteCond %{REQUEST_FILENAME} !-f&lt;br /&gt; RewriteCond %{REQUEST_FILENAME} !-d&lt;br /&gt; RewriteRule . /index.php [L]&lt;br /&gt;&lt;/ifmodule&gt;&lt;br /&gt;# END WordPress&lt;br /&gt;&lt;br /&gt;If WordPress is installed in some subdirectory “foo”, WordPress creates and uses the following htaccess directives:&lt;br /&gt;&lt;br /&gt;# BEGIN WordPress&lt;br /&gt;&lt;ifmodule&gt;&lt;br /&gt; RewriteEngine On&lt;br /&gt; RewriteBase /foo/&lt;br /&gt; RewriteCond %{REQUEST_FILENAME} !-f&lt;br /&gt; RewriteCond %{REQUEST_FILENAME} !-d&lt;br /&gt; RewriteRule . /foo/index.php [L]&lt;br /&gt;&lt;/ifmodule&gt;&lt;br /&gt;# END WordPress&lt;br /&gt;Random Tricks&lt;br /&gt;&lt;br /&gt;Activate SSI for HTML/SHTML file types:&lt;br /&gt;&lt;br /&gt;# activate SSI for HTML and or SHTML file types&lt;br /&gt;AddType text/html .html&lt;br /&gt;AddType text/html .shtml&lt;br /&gt;AddHandler server-parsed .html&lt;br /&gt;AddHandler server-parsed .shtml&lt;br /&gt;AddHandler server-parsed .htm&lt;br /&gt;&lt;br /&gt;Grant CGI access in a specific directory:&lt;br /&gt;&lt;br /&gt;# grant CGI access in a specific directory&lt;br /&gt;Options +ExecCGI&lt;br /&gt;AddHandler cgi-script cgi pl&lt;br /&gt;# to enable all scripts in a directory use the following&lt;br /&gt;SetHandler cgi-script&lt;br /&gt;&lt;br /&gt;Disable magic_quotes_gpc for PHP enabled servers:&lt;br /&gt;&lt;br /&gt;# turn off magic_quotes_gpc for PHP enabled servers&lt;br /&gt;&lt;ifmodule&gt;&lt;br /&gt; php_flag magic_quotes_gpc off&lt;br /&gt;&lt;/ifmodule&gt;&lt;br /&gt;&lt;br /&gt;Enable MD5 digests:&lt;br /&gt;&lt;br /&gt;Note: enabling this option may result in a relative decrease in server performance.&lt;br /&gt;&lt;br /&gt;# enable MD5 digests via ContentDigest&lt;br /&gt;ContentDigest On&lt;br /&gt;&lt;br /&gt;Expression Engine Tricks:&lt;br /&gt;&lt;br /&gt;# send Atom and RSS requests to the site docroot to be rewritten for ExpressionEngine&lt;br /&gt;RewriteRule .*atom.xml$ http://www.yoursite.com/index.php/weblog/rss_atom/ [R]&lt;br /&gt;RewriteRule .*rss.xml$ http://www.yoursite.com/index.php/weblog/rss_2.0/ [R]&lt;br /&gt;&lt;br /&gt;# cause all requests for index.html to be rewritten for ExpressionEngine&lt;br /&gt;RewriteRule /.*index.html$ http://www.domain.com/index.php [R]&lt;div class="blogger-post-footer"&gt;Taken From : Speedybiz Blog Network&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1343133296744135180-4141617423710777143?l=speedybiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedybiz.blogspot.com/feeds/4141617423710777143/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1343133296744135180&amp;postID=4141617423710777143' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1343133296744135180/posts/default/4141617423710777143'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1343133296744135180/posts/default/4141617423710777143'/><link rel='alternate' type='text/html' href='http://speedybiz.blogspot.com/2008/07/superb-htaccess-tricks.html' title='Superb htaccess Tricks'/><author><name>speedybiz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp1.blogger.com/_RJhWWe1VrV8/SFFGoy0rStI/AAAAAAAAAAU/aOr375h3bXI/S220/speedybiz_superhero.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1343133296744135180.post-5371248632806480349</id><published>2008-06-30T10:46:00.004+07:00</published><updated>2008-06-30T10:57:59.441+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Blogging'/><title type='text'>A - Z of Professional Blogging</title><content type='html'>Following is my A to Z of Professional blogging including blogging tools, platforms, services and ways of making money from blogging (in fact whether you blog for money or not much of what follows should help you improve your blogging).&lt;br /&gt;&lt;br /&gt;I hope you enjoy it and feel free to share your own tools and services in comments (I’m sure I’ll have missed some).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A&lt;br /&gt;AdSense - contextual ad program by Google&lt;br /&gt;Adbrite - sell text ads&lt;br /&gt;Amazon Associates - popular affiliate program&lt;br /&gt;aStore - add an Amazon Store to your Blog&lt;br /&gt;AdGenta - text ads by Qumana (see ‘Q’)&lt;br /&gt;AdRotator - WP ad rotating plugin&lt;br /&gt;Akismet - Comment Spam Fighting Tool&lt;br /&gt;Adhearus - pay per click advertising&lt;br /&gt;AdWords - the advertisers side of AdSense - many bloggers use it to promote their blogs&lt;br /&gt;AzoogleAds - advertising system&lt;br /&gt;Audio Blogger - adds audio to your blog&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;B&lt;br /&gt;Build A Niche Store- add an eBay store to your site&lt;br /&gt;Bidvertiser - bid based advertising&lt;br /&gt;Blog Ads - blog advertising network&lt;br /&gt;Blog Jet - blog editing tool&lt;br /&gt;Blog Desk - blog editing tool&lt;br /&gt;Bloglines - Web based RSS feed reader&lt;br /&gt;BlogPulse - blog search tool&lt;br /&gt;BlogPolls - tool for putting polls on your blog&lt;br /&gt;Blog Poll - another blog poll tool&lt;br /&gt;Backpackit - useful organizational tool&lt;br /&gt;Blogger.com - blog platform&lt;br /&gt;Bloggers for Hire - bloggers looking for work and potential employers looking for bloggers&lt;br /&gt;BlogSitter.net - service for find guest bloggers while you take a holiday&lt;br /&gt;BlogBurst - syndicates bloggers content for mainstream medium&lt;br /&gt;BlogFlux - blog services portal&lt;br /&gt;BlogRolling - a blogroll management tool&lt;br /&gt;Blogbeat - blog metrics tool&lt;br /&gt;Blogger Jobs - a blog following the advertising of blog jobs&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;C&lt;br /&gt;Chitika eMiniMalls - advertising program&lt;br /&gt;CrispAds - blog advertising network&lt;br /&gt;Creative Commons - copyright licenses&lt;br /&gt;Copyscape - tool for checking for content theft/plagiarism&lt;br /&gt;Clicksor - advertising program&lt;br /&gt;Clickbank - library of many affiliate products&lt;br /&gt;Commission Junction - collection of many affiliate programs&lt;br /&gt;Casale Media - advertising solution&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;D&lt;br /&gt;Del.icio.us - social bookmarking&lt;br /&gt;Digg - social bookmarking&lt;br /&gt;Drupal - blog platform&lt;br /&gt;DomainsBot - a tool for finding domain names&lt;br /&gt;Digital Point - useful forum for webmasters&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;E&lt;br /&gt;Ecto - blog editing tool&lt;br /&gt;Expression Engine - blog platform&lt;br /&gt;Endo - News aggregator for Mac Users&lt;br /&gt;Ether - lets readers book a consulting call with you from your sidebar&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;F&lt;br /&gt;Feedburner - RSS feed management tool - also provides Feed Advertising&lt;br /&gt;Feedster - RSS search Tool&lt;br /&gt;FeedDemon - RSS reader from NewsGator&lt;br /&gt;FeedBlitz - email blog and RSS subscription service&lt;br /&gt;Flickr - photo sharing and hosting&lt;br /&gt;Flock - a browser with in built blogging&lt;br /&gt;Furl - social bookmarking&lt;br /&gt;Free Blog Polls&lt;br /&gt;FilmLoop - free photocasting network&lt;br /&gt;Feedpass - RSS management - integrates with AdSense&lt;br /&gt;Favicon Maker - make Favicons from photos&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;G&lt;br /&gt;Google Analytics - Metrics Tool&lt;br /&gt;Gabbly - add chat to your blog&lt;br /&gt;Google Reader - RSS reader&lt;br /&gt;Gnoos - Australian made blog search tool&lt;br /&gt;Google News - tracking news - many use it as a source of content&lt;br /&gt;Google Blog Search - Google’s…. blog search&lt;br /&gt;Google Sitemaps - get indexed in Google&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;H&lt;br /&gt;Haloscan - a free commenting system for blogs (a little dated but I was a tad desperate for a ‘H’&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I&lt;br /&gt;IntelliTXT - In text advertising&lt;br /&gt;Ice Rocket - blog search engine&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;J&lt;br /&gt;Jar (as in Tip Jar) - many bloggers ask their readers for donations/tips - but few make much from them&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;K&lt;br /&gt;Kanoodle - Advertising program&lt;br /&gt;Kontera - In text advertising&lt;br /&gt;Keyword and Backlink Tracker - Search Engine ranking tool&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;L&lt;br /&gt;LiveJournal - Blog Platform&lt;br /&gt;Linkshare - Affiliate Program&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;M&lt;br /&gt;Mars Edit - Blog Editing Tool&lt;br /&gt;Memeorandum - Tracking and Aggregating news from blogs&lt;br /&gt;MyBlogLog - Metrics Tool&lt;br /&gt;Mint - Blog Metrics Tool&lt;br /&gt;MovableType - Popular blog platform&lt;br /&gt;MeCommerce - Sidebar shop - in beta&lt;br /&gt;MSN Adcenter - Coming Soon - Contextual ads&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;N&lt;br /&gt;NewsGator - RSS News Readers&lt;br /&gt;Nichebot - keyword research tool&lt;br /&gt;Nameboy - domain name generator&lt;br /&gt;Nucleus CMS - open source blog platform&lt;br /&gt;Netvibes - RSS News Aggregator&lt;br /&gt;Netscape Beta - Social Bookmarking Tool&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;O&lt;br /&gt;Only Wire - social bookmarking service&lt;br /&gt;Overture Keyword Tool - keyword research tool&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;P&lt;br /&gt;Performancing - great blog, firefox blog editor and metrics tools&lt;br /&gt;Pheedo - RSS advertising&lt;br /&gt;Post2Blog - Blog Editing tool - blog using Word, IE or Firefox&lt;br /&gt;Pingoat - Pinging Tool&lt;br /&gt;Pingomatic - Pinging Tool&lt;br /&gt;pMachine - Blog Platform&lt;br /&gt;Paypal - Payment tool - used by many affiliate programs and ad systems to pay publishers&lt;br /&gt;PPCalc - Paypal Fee Calculator&lt;br /&gt;PubSub - service that notifies you of new content&lt;br /&gt;Photobucket - image and video hosting&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q&lt;br /&gt;Qumana - Blog Editing Tool&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;R&lt;br /&gt;Rojo - RSS feed reader&lt;br /&gt;RocketPost - Blog posting tool&lt;br /&gt;Right Media - advertising&lt;br /&gt;Rmail - subscribe from any RSS feed to email&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;S&lt;br /&gt;Sitemeter - a free website stats tool used by many bloggers&lt;br /&gt;Six Figure Blogging - learn to make money blogging (one of my blogging resources)&lt;br /&gt;Shoplinc - add a Chitika store to your blog&lt;br /&gt;Scoopt Words - service to sell bloggers content to mainstream media editors&lt;br /&gt;Sitening - Search Engine ranking tracker&lt;br /&gt;Sparklines - sidebar widgets/graphs&lt;br /&gt;Skype - VOIP tool for networking, podcast interviews etc&lt;br /&gt;Spam Karma - WP comment spam tool&lt;br /&gt;Sitepoint - Forums for webmasters&lt;br /&gt;Slide - photo hosting, slideshows etc&lt;br /&gt;SoloSub - RSS feed management tool&lt;br /&gt;Squidoo - good alternative place to put content, make money and promote your blog&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;T&lt;br /&gt;Text Link Ads - text link advertising system&lt;br /&gt;Technorati - Blog Search engine&lt;br /&gt;Topix - News service - used by many bloggers to find stories&lt;br /&gt;TagCloud - tool for making tag clouds&lt;br /&gt;TinyURL - make long URLs tiny ones&lt;br /&gt;TypePad - Hosted Blogging Platform&lt;br /&gt;Tribal Fusion - Impression Based Ads&lt;br /&gt;3bubbles - live chat on a blog&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;U&lt;br /&gt;Unobtrusive Sidenotes - a way of putting sidenotes in your posts&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;V&lt;br /&gt;ValueClick - Impression Based Ad Program (was FastClick)&lt;br /&gt;Vizu - blog polls tool&lt;br /&gt;Vox - a new blogging/social bookmarking platform from Six Apart (in beta)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;W&lt;br /&gt;WordPress - Blog Platform - very popular&lt;br /&gt;w.bloggar - blog editing tool&lt;br /&gt;Webpad - web based text editor&lt;br /&gt;Weblogs.com - recently updated blogs - aggregator&lt;br /&gt;WebmasterWorld - forums for webmasters&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;X&lt;br /&gt;Xanga - Weblog Community&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Y&lt;br /&gt;YPN - Contextual Advertising Service&lt;br /&gt;Yutter - RSS/Blog Subscription Service&lt;br /&gt;YouTube - Video Hosting/Sharing&lt;br /&gt;Yutter - RSS/Blog Subscription Service&lt;br /&gt;Yahoo News - Tracking News from around the Web&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Z&lt;br /&gt;Zookoda - RSS to Email and Newsletter tool&lt;br /&gt;Zoudry - blog editor&lt;div class="blogger-post-footer"&gt;Taken From : Speedybiz Blog Network&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1343133296744135180-5371248632806480349?l=speedybiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedybiz.blogspot.com/feeds/5371248632806480349/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1343133296744135180&amp;postID=5371248632806480349' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1343133296744135180/posts/default/5371248632806480349'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1343133296744135180/posts/default/5371248632806480349'/><link rel='alternate' type='text/html' href='http://speedybiz.blogspot.com/2008/06/z-of-professional-blogging.html' title='A - Z of Professional Blogging'/><author><name>speedybiz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp1.blogger.com/_RJhWWe1VrV8/SFFGoy0rStI/AAAAAAAAAAU/aOr375h3bXI/S220/speedybiz_superhero.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1343133296744135180.post-3913519090076683277</id><published>2008-06-24T09:58:00.000+07:00</published><updated>2012-01-14T07:20:23.101+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Monetize'/><title type='text'>How to Making Some Extra Money From Your Blog</title><content type='html'>It seems as though many bloggers find sponsored postings and compensated insertions bad. I could understand a blog being pretty annoying if every other post was a sponsored article; but what if that person was just making some extra money? That is exactly what I plan on doing.&lt;br /&gt;&lt;br /&gt;I’ve never been one to really get too big into the monetization of my personal website; party because I did not want to fill the site up with advertisements or any text-link-ads. However, over time, I have slowly realized that this is not so bad after all. I can still maintain my pretty little design template while placing a few ads here and there.&lt;br /&gt;&lt;br /&gt;PayPerPost.com has really stepped into the market place and allowed a pretty plentiful amount of organizations and individuals to get their name onto some large blogs. The only flaw I have with Pay per post’s setup is the disclosure policy they have for word of mouth ethics. I believe that blogging is pretty much like the movie and entertainment industry. Everything is exposure, everything is compensated, everything is an advertisement. That is why Google gives away free t-shirts and Camel free cigarettes at bars. What I just did, without compensation advertised for Budweiser and Camel. At the same time, maybe I was some how compensated — over time — through other mediums.&lt;br /&gt;&lt;br /&gt;It is the same concepts towards sponsored postings. I’m only going to mention something if I am going to benefit some how. I mean.. mostly. I’m not going benefit from linking my viewers to my buddies photo gallery or business he or she just started; but I will benefit slightly.. I post a link, my friend is happy — my compensation is making my friend happy..&lt;br /&gt;&lt;br /&gt;However, all in all — Payperpost is pretty slick! If nothing else, I plan on using it to make some extra money here and there.. not to mention you, my viewers will get some extra reading materials!&lt;div class="blogger-post-footer"&gt;Taken From : Speedybiz Blog Network&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1343133296744135180-3913519090076683277?l=speedybiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedybiz.blogspot.com/feeds/3913519090076683277/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1343133296744135180&amp;postID=3913519090076683277' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1343133296744135180/posts/default/3913519090076683277'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1343133296744135180/posts/default/3913519090076683277'/><link rel='alternate' type='text/html' href='http://speedybiz.blogspot.com/2008/06/making-some-extra-money-from-your-blog.html' title='How to Making Some Extra Money From Your Blog'/><author><name>speedybiz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp1.blogger.com/_RJhWWe1VrV8/SFFGoy0rStI/AAAAAAAAAAU/aOr375h3bXI/S220/speedybiz_superhero.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1343133296744135180.post-5450934421904148013</id><published>2008-06-20T17:20:00.000+07:00</published><updated>2012-01-14T07:20:23.102+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='General'/><category scheme='http://www.blogger.com/atom/ns#' term='Niche'/><title type='text'>9 Simple Steps How to Build a Great Niche Web Site</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://img514.imageshack.us/img514/5624/nichewebsitesw6.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 149px; height: 224px;" src="http://img514.imageshack.us/img514/5624/nichewebsitesw6.jpg" alt="" border="0" /&gt;&lt;/a&gt;Maybe you’ve been wondering how to go about setting up a niche web site. Well, here’s a quick little article that will show you how to create your very own affiliate web site. Please note: this is the cheat sheet version. There is a lot more information you should learn about this subject before you get started.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;Step 1. Pick a Niche Subject&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This may be the hardest part of your web site project. There’s literally tons of subjects to choose from. People are interested in a variety of things – from parrots to pilots. You don’t have to necessarily pick something you’re interested in, but it helps.&lt;br /&gt;&lt;br /&gt;You’re more likely to do a better job at building your site when you have some interest in the subject matter. It’s like taking a high school or college class. Some subjects are more interesting than others. Make sure you choose something that a reasonable amount of people are actually searching for online and want to find out more information about.&lt;br /&gt;&lt;br /&gt;Here’s a free tool that will help you check the popularity of specific subjects: (http://www.nichebot.com/)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;Step 2. Do Keyword Research&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is a part that many people skip. I’ve made that mistake myself and suffered the consequences – a failed web site. Even though it’s nice to think that you can write anything you want and have total creative freedom, not using keyword rich content is a BIG mistake.&lt;br /&gt;&lt;br /&gt;I’d rather lose some creative freedom and attract visitors to my site, than have a lot of flowery prose that zero people will see. You MUST include targeted keywords in your web site copy. Also, make sure you use your targeted keywords in the upper third portion of your web site pages. This is also called optimizing your web site for the search engines. Use the Overture Keyword Tool for research: http://inventory.overture.com/d/searchinventory/suggestion&lt;br /&gt;&lt;br /&gt;Note: keywords must be relevant to the THEME (subject) of your site. Be careful not to over use them. Search engines don’t like keyword SPAM.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Step 3. Get A Domain Name&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Having a unique domain name is important, although some don’t agree. However, a unique domain name makes your site look more professional and trustworthy to visitors. I use BuyDomains (http://www.buydomains.com/). They are not the cheapest, but I stick with them because I like their easy interface and good customer service.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Step 4. Write Keyword Rich Content&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This may be a hard step for those of you who don’t consider yourselves writers. But, writing web site copy is not as hard as it seems. Just think of it as having a conversation with a friend about a product or service you’re really enthusiastic about.&lt;br /&gt;&lt;br /&gt;Don’t think you can extol the benefits of your subject? Tune your TV into QVC or one of the other shopping networks to see how they can spend several minutes talking about the benefits of all kinds of mundane products. This is what you’ll be doing for your web site.&lt;br /&gt;&lt;br /&gt;Your copy should feature a good balance of friendliness and professionalism. Remember, you’re passing along useful information to your visitor. Put yourself in their shoes. What would you want to know about xyz subject if you were them? Now, write that down. Don’t forget to sprinkle targeted keywords throughout your copy. I print out a list of them to use for my sites.&lt;br /&gt;&lt;br /&gt;If you simply can’t put words onto the page and find yourself staring at a blank screen, then visit Internet marketing forums like Willie Crawford’s (http://www.williecrawford.com/cgi-bin/index.cgi) for suggestions on finding writers. Or, visit Elance (http://www.elance.com/).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Step 5. Build Your Web Site&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Ok. You’ve created your copy. Now it’s time to build the actual physical web site. I use Homestead (http://www.homestead.com/), but there are many good point and click web site builders out there.&lt;br /&gt;&lt;br /&gt;You have a lot of creative freedom on how you want your site to look (I prefer black copy on white backgrounds with photos), but remember that people are looking for attractive, easy-to-navigate sites with useful information.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Step 6. Sign Up for Matching Affiliate Programs&lt;/span&gt;&lt;br /&gt;You’ve created a web site about xyz subject. Now look for affiliate vendors who perfectly match the theme of your site. Integrate your affiliates attractively into your web site copy. Don’t confuse your visitors by giving them too many choices.&lt;br /&gt;&lt;br /&gt;If you want to list a lot of affiliates on the same page, you can create a helpful “resource guide” page.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Step 7. Include Google Adsense Ads&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Google has a great program for web site owners who wish to make a little extra money for simply displaying google ads on their web site. It’s easy to sign up and free. Just visit google.com/ads and sign up for their Adsense program. They’ll give you some html code to copy and paste on your site.&lt;br /&gt;&lt;br /&gt;While google decides which ads will actually appear on your site, you can decide how the google ads will look – choose colors, borders, etc. and where to put them on your pages.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Step 8. Find Link Partners&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I found out that exchanging links with other web site owners is a MUST if you want to improve your search engine rankings. Google especially will consider your site more relevant if your site has other sites linking to it. Also the ad copy from other sites, if relevant, can add more valuable keyword content to your own site.&lt;br /&gt;&lt;br /&gt;I use Linkmarket.Net to find credible web sites to exchange links with. It’s free to join.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Step 9. Write Articles to Promote Your Site&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Oh oh. Here’s that writing thing again. Well, you better get used to it, because writing articles like this one (normally your articles will be about the subject matter of your web site) will help give your affiliate web site much needed exposure. It doesn’t matter if you write them yourself or hire others (ghostwriters) to write them for you.&lt;br /&gt;&lt;br /&gt;You’ll find that the best Internet marketers all write articles to promote themselves, their newsletters, and products and services. Remember, there’s a reason the Internet is called the “information” super highway.&lt;br /&gt;&lt;br /&gt;After writing your articles, you can post them to an article directory site like Article City (http://www.articlecity.com/). People can easily find your articles to use as free content for their sites.&lt;div class="blogger-post-footer"&gt;Taken From : Speedybiz Blog Network&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1343133296744135180-5450934421904148013?l=speedybiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedybiz.blogspot.com/feeds/5450934421904148013/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1343133296744135180&amp;postID=5450934421904148013' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1343133296744135180/posts/default/5450934421904148013'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1343133296744135180/posts/default/5450934421904148013'/><link rel='alternate' type='text/html' href='http://speedybiz.blogspot.com/2008/06/9-simple-steps-how-to-build-great-niche.html' title='9 Simple Steps How to Build a Great Niche Web Site'/><author><name>speedybiz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp1.blogger.com/_RJhWWe1VrV8/SFFGoy0rStI/AAAAAAAAAAU/aOr375h3bXI/S220/speedybiz_superhero.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1343133296744135180.post-3592901210345017120</id><published>2008-06-20T06:00:00.000+07:00</published><updated>2012-01-14T07:20:23.102+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Monetize'/><title type='text'>Hot Internet Businesses For 2008</title><content type='html'>&lt;div style="text-align: left;"&gt;&lt;a style="" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://img295.imageshack.us/img295/5440/hmmlogone5.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 199px; height: 188px;" src="http://img295.imageshack.us/img295/5440/hmmlogone5.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;span style="font-style: italic;font-size:130%;" &gt;If you are planning to start a new business in 2008, you should seriously consider one of the many Internet based businesses available today. The online businesses have numerous inherent advantages in comparison to their brick and mortar counterparts.&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Investment is relatively small&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The basic elements to start an online business are the followings: a good product or service, an online presence, and a good marketing plan. All these things can be done on a shoe-string budget. You won’t require more than US$ 2000 to start any of the business described below. In most of the cases, the investment can be even lower. Quick to launch&lt;br /&gt;&lt;br /&gt;Once you know, what products or services you are going to sell, you can, basically, start your business within three to four weeks. Some of the online businesses don’t even take more than two to three days to start.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Large audience&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Internet is big and it’s getting bigger! Whatever business you prefer to start, Internet allows you to tap instantly into a huge number of potential customers, which is, virtually, impossible to do with a brick and mortar enterprise.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Huge growth potential&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;With the Internet, sky is the limit! If you have a good product, service or idea, you can create a dot com behemoth over night! Smart guys are doing this! Internet success examples are abound.&lt;br /&gt;&lt;br /&gt;Work from home&lt;br /&gt;&lt;br /&gt;The best thing about online business is you can take care of it even while you are on vacation. No office is necessary; you work from home, if that is what you prefer.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Less paper work&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Since starting for your quotation and purchase orders to the invoices and shipment tracking, everything is done online; you hardly have to do any paper work.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Flexible time schedule&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;No longer have you had to work nine to five! You set your own schedules. Although, with any new business, initially, you have to work very hard, however, the time flexibility allows you to do other important things whenever it’s necessary.&lt;br /&gt;&lt;br /&gt;There is no limit to Internet business ideas. Savvy entrepreneurs are constantly coming up with mind-boggling online projects and striking rich in no time.&lt;br /&gt;&lt;br /&gt;Here I have chosen several of the online businesses with great upward potential with proven success history.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;1- Selling information&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you are asked, what do you do on the Internet most of the time? The answer, most probably, will be searching or retrieving information. You are not alone! A survey conducted by Neilsen Media Research shows that Books and Information Category tops the highest selling product and service on the Internet with a significant margin in comparison to other categories. This makes information a natural product for sale on the Internet. Information sells online in the formats of e-books, articles, reports, data, whitepapers etc. If you have expertise in any specific field, you may consider selling your ideas in one of the mentioned format. Check out Clickbank’s marketplace to get a good idea what people are selling. You will be truly amazed by the scope of ideas!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;2- Travel agency&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;According to Jupitar Research the U.S. online travel market has grown at a fast pace over the last year, totaling $54 billion in 2004, or 23% of travel purchased. The online market is projected to grow to $91 billion in 2009, or 33% of travel purchased.&lt;br /&gt;&lt;br /&gt;Apart from being a soaring market, travel agency is also highly rewarding and satisfactory business. The interesting thing about this business is your own network of acquaintances is also your potential customers.&lt;br /&gt;&lt;br /&gt;The success of this business will depend on your target market and product that you are going to sell. Choose a very niche product and focus on a specific market segment. For example: Red Sea Rivera of Egypt is increasingly becoming a primer destination for many sun worshippers. Try working with several of the hotels from this area. Create package deals and offer to European customers.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;3- eBay store&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;eBay has grown into the largest online marketplace in the world. Entrepreneurs are taking advantage of this. Opening a store on the eBay is fairly easy. However, the competition is stiff! There are nearly half a million stores are selling almost anything you can think off. In order to be successful you have to choose your products very carefully. The best selling items on the auction marketplace are collectibles, books, computer software and hardware, clothing, home and garden supplies, business supplies, wholesale lots, DVDs, special events tickets and even cars and real estates. If you don’t have your own products or you don’t want to physically handle a product, you can consider selling drop-ship items.&lt;br /&gt;&lt;br /&gt;The main reason why you should mull over selling your products through eBay is the sheer number of visitors eBay gets. By no means, an average website can bring you so many customers.&lt;br /&gt;&lt;br /&gt;If you find difficulties doing the auction sales yourself, you can also concentrate on seeking out products and selling them through eBay drop off stores. You can also come up with your own drop off store.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;4- Web service firm&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Services required by the Internet users and online businesses are increasing enormously. The Internet service industry is evolving so fast that for their various requirements, many companies, today, prefer outsourcing as oppose to doing things by hiring employees.&lt;br /&gt;&lt;br /&gt;Large and small companies started to realize that it’s more cost-effective and time-saving to outsource sophisticated business related services, which are not their core business. This has created a flourishing industry, part of which did not even exist several years ago.&lt;br /&gt;&lt;br /&gt;To be successful in this market you have to know what’s the odds are. A rush to provide complex solutions of vast range that fail to provide benefits at reasonable costs for businesses will sure take you out of business very fast.&lt;br /&gt;&lt;br /&gt;The services that you can provide may include:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;    Website design&lt;/li&gt;&lt;li&gt;    Website promotion&lt;/li&gt;&lt;li&gt;    Online security consulting&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;5- Export Import Business&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Thanks to the Internet, getting into import export business has never been easier. As the nations are accumulating wealth, their demand for foreign made products is also swelling. You can be a part of this action too! Whether you are planning to import or export, Internet resources can be of great help too you. The trade leads site, B2B exchanges and various marketplaces have made sourcing and selling products and services globally simple, effective and inexpensive. You can also create your web store with many of the B2B exchanges and run your business processes solely online.&lt;div class="blogger-post-footer"&gt;Taken From : Speedybiz Blog Network&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1343133296744135180-3592901210345017120?l=speedybiz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedybiz.blogspot.com/feeds/3592901210345017120/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1343133296744135180&amp;postID=3592901210345017120' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1343133296744135180/posts/default/3592901210345017120'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1343133296744135180/posts/default/3592901210345017120'/><link rel='alternate' type='text/html' href='http://speedybiz.blogspot.com/2008/06/hot-internet-businesses-for-2008.html' title='Hot Internet Businesses For 2008'/><author><name>speedybiz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp1.blogger.com/_RJhWWe1VrV8/SFFGoy0rStI/AAAAAAAAAAU/aOr375h3bXI/S220/speedybiz_superhero.jpg'/></author><thr:total>0</thr:total></entry></feed>
