01 Haziran 2009 Pazartesi

Most populer social media publishing add-ons & plugins for wordpress blogs

0 yorum
We wbmasters all tring to get a bit of this huge web traffic crossing from our near side when we look at big sites gaining huge number of web visitors and big numbers of web traffics, when we look the websites with successfull stories and when we analize them good enough, we all see their populating methods and advertisers and social media connections...
Yes, sharing your content and links with social network sites is not a desavantage for your website or company, becouse social media networks lets you own the big numbers of traffics to you back in a short time.

Here are some add-ons and plugins you can use in your wordpress blog or blog systems...

1. Sociable

Sociable is a plugin which adds social media buttons to your posts, and does so easily, and beautifully.
Download

http://yoast.com/wordpress/sociable/

2. Bookmark Me

Bookmark me is a WordPress plugin made to add the “social bookmark buttons” on each post. It is different to other social bookmarks plugins because it’s focused on collecting non-english bookmarks site.
Download

3. Bookmarkify

The Social Media Marketing Plugin that lets you put social bookmarking links in your posts and other pages. Help your readers promote your blog and watch your traffic grow!
Download

bookmarkify plugin

4. ShareThis

This is very widely used plugin.
Download

sharethis plugin

5. PingPressFM

PingPressFM is a WordPress plugin which submits your posts to Ping.fm. A service which can update more than 30 snetworks from one source.
Download

6. obsocialbookmarker

obsocialbookmarker is a social bookmarking plugin which adds user-submission links at the bottom of each post for various social bookmarking sites.
Download

7. iBegin Share

iBegin Share is the 100% open source solution that makes sharing and spreading your content easier than ever, all while giving you complete control.
Download

8. I Love Social Bookmarking

I Love Social Bookmarking is a simple WordPress plugin that allows your readers to submit your content to social media services via a clutter-free drop-down list of attractive icons.
Download

I Love Social Bookmarking

9. Social Bookmarking RELOADED

The Social Bookmarking RELOADED plugin for WordPress adds a list of XHTML compliant graphic links at the end of your posts and/or pages that allow your visitors to easily submit them in a number of social bookmarking sites.
Download

10. Social Bookmarks

Gives you 50 social bookmarking submission icons to choose from including all of the major bookmarking services and lots of smaller ones.
Download

11. Social Dropdown

This plugin displays several social bookmarking options in a dropdown. Unlike other social bookmarking displays, this does not cause clutter and takes up little screen space.
Download

socialdropdown plugin

12. SociBook

A really simple plugin that will add bookmark links of Del.icio.us, Digg it, Slashdot, RawSugar, Yahoo! MyWeb, and many other links to your wordpress. You can decide which bookmark services you want to show and in what order. You also can define, a own iconset.
Download

13. SocioFluid

SocioFluid adds to your wordpress posts the buttons to the major bookmarking sites.
I am using this plugin on this blog. As i like its look and big icons display.
Download

14. WP PunchCard

WP PunchCard is a WordPress plugin for installing PunchCard into WordPress with extreme simplicity.
Download

15. ComplexLife

This is a lifestreaming WP plugin.
Download

16. Follow Me

The Follow Me widget allows you to display links to all your social media profiles in one, easy-to-access button or window.
Download

followme

17. LifeStream

Lifestream displays your social feeds and photos much like you would see it on many of the social networking sites.
Download

18. Meet Your Commenters

When someone comments on your blog and writes a comment with his/her URL, is leaving more information than you think. This wordpress plugin displays web pages and profiles of those users in the dashboard, so you can add them as friends if you are in the same social network
Download

Meet Your Commenters plugin

19. Retaggr

Using this plugin you can make your virtual business card which links to your social networking profiles.
Download

retaggr

20. SezWho

Using this plugin you can make your virtual business card which links to your social networking profiles.
Download

21. Social Homes

A WordPress plug-in which adds a sidebar widget containing a subtle list of all your social homes as linked favicons.
Download

22. Digg Digg

Digg Digg is a social vote button wordpress plugin, which including Digg, Reddit, Dzone and Yahoo Buzz buttons wordpress content integration.
Download

23. Digg This

Digg this wordpress plugin is a plugin that detects incoming links from Digg.com to your wordpress post and automatically display a link back to the digg post, for people to digg your story.
Download

24. DiggZ-Et

It automatically displays a “digg” button for each post/page.
Download

25. Dugg Widget

Displays your past 10 dugg stories and make it a widget.
Download

26. FriendFeed Activity Widget

The FriendFeed Activity Widget is a simple WordPress widget plugin that pulls your FriendFeed stream, pretties it up a bit and shares it with visitors to your blog. It’s essentially a lifestream plugin that requires just a few steps to set up.
Download

27. FriendFeed Comments WordPress Plugin

This plugin will allow you to display on your own site the comments that people make on FriendFeed about your post.
Download

28. Stumble Reviews

Allows you to add the reviews that appear on StumbleUpon (StumbleUpon reviews) for a given page to be displayed on that page.
Download

29. Twitter Updater

The Twitter Updater automatically sends a Twitter status update to your Twitter account when you create, publish, or edit your WordPress post.
Download

30. WordPress Twitter Widget

Twitter Widget Pro properly handles twitter feeds, including @username and link parsing, feeds that include friends or just one user, and can even display profile images for the users.
Download

31. WP-Profilactic

The WP-Profilactic Plugin publishes your LifeStream or informs readers where to find you online by parseing your aggregated online activity feed from Profilactic.
Download

32. Hocus Pocus Buttons

Hocus Pocus Buttons is a Wordpress-Plugin that provides sidebar widget with a widerange set of buttons for social bookmarking websites.
Download

33. KnxDT Bookmarks

With this plugin you can send and share your favorites posts (your readers can do this too) to popular social bookmarking services like Digg, Meneame, Delicious, Technorati, Yahoo, Google.
Download

34. Gregarious

The Gregarious plugin supersedes the Digg This Reloaded Plugin and allows for seamless integration between your Wordpress Blog and social bookmarking sites such as Digg.com, Del.icio.us, Reddit and more.
Download

35. Hey Social

Hey Social is the coolest way to interact with the visitors of your blog,
Download

31 Mayıs 2009 Pazar

The Best Htaccess Guide .htaccess Tutorials

0 yorum

The Hyper Text Transfer Protocol (HTTP) was initiated at the CERN in Geneve (Switzerland), where it emerged (together with the HTML presentation language) from the need to exchange scientific information on a computer network in a simple manner. The first public HTTP implementation only allowed for plain text information, and almost instantaneously became a replacement of the GOPHER service. One of the first text-based browsers was LYNX which still exists today; a graphical HTTP client appeared very quickly with the name NCSA Mosaic. Mosaic was a popular browser back in 1994. Soon the need for a more rich multimedia experience was born, and the markup language provided support for a growing multitude of media types.

The following .htaccess tricks, .htaccess tips, examples, samples, tutorials, tools, and plethora of “How To” htaccess articles on creating and using htaccess files will do several things for you, just like its done for me.

  • Make your website noticeably faster.
  • Allow you to debug your server with ease.
  • Make your life easier and more rewarding.
  • Allow you to work faster and more productively.

What Is .htaccess

.htaccess is a very ancient configuration file that controls the Web Server running your website, and is one of the most powerful configuration files you will ever come across. Htaccess is sometimes called: “HyperText Access” because of its ability to control access of the WWW’s HyperText Transfer Protocol (HTTP) using Password Protection, Allow and Deny capabilities, and more.

Specifically, .htaccess is the default file name of a special configuration file that provides a number of directives (commands) for controlling and configuring the Apache Web Server, and also to control and configure modules that can be built into the Apache installation, or included at run-time like mod_rewrite (for htaccess rewrite), mod_alias (for htaccess redirects), and mod_ssl (for controlling SSL connections).

Htaccess allows for decentralized management of Web Server configurations which makes life very easy for web hosting companies and especially their savvy consumers. They set up and run “server farms” where many hundreds and thousands of web hosting customers are all put on the same Apache Server. This type of hosting is called “virtual hosting” and without .htaccess files would mean that every customer must use the same exact settings as everyone else on their segment. So that is why any half-decent web host allows/enables (DreamHost, Powweb, MediaTemple, GoDaddy) .htaccess files, though few people are aware of it. Let’s just say that if I was a customer on your server-farm, and .htaccess files were enabled, my websites would be a LOT faster than yours, as these configuration files allow you to fully take advantage of and utilize the resources allotted to you by your host. If even 1/10 of the sites on a server-farm took advantage of what they are paying for, the providers would go out of business.

Creating Htaccess Files

What an Htaccess File Looks Like in Windows ExplorerHtaccess files use the default filename “.htaccess” but any unix-style file name can be specified from the main server config using the AccessFileName directive. The file isn’t .htaccess.txt, its literally just named .htaccess.

Shows how to change the folder settings in Windows Explorer to view .htaccess filesIn a Windows Environment like the one I use for work, you can change how Windows opens and views .htaccess files by modifying the Folder Options in explorer. As you can see, on my computer files ending in .htaccess are recognized as having the HTACCESS extension and are handled/opened by Adobe Dreamweaver CS4.

Htaccess Scope

Unlike the main server configuration files like httpd.conf, Htaccess files are read on every request therefore changes in these files take immediate effect. Apache searches all directories and subdirectories that are htaccess-enabled for an .htaccess file which results in performance loss due to file accesses. I’ve never noticed a performance loss but OTOH, I know how to use them. If you do have access to your main server configuration file, you should of course use that instead, and lucky for you ALL the .htaccess tricks and examples can be used there as well (just not vice versa).

Htaccess File Syntax

Htaccess files follow the same syntax as the main Apache configuration files, for powerusers here’s an apache.vim for VI. The one main difference is the context of the directive, which means whether or not that directive is ALLOWED to be used inside of an .htaccess file. Htaccess files are incredibly powerful, and can also be very dangerous as some directives allowed in the main configuration files would allow users/customers to completely bypass security/bandwidth-limits/resource-limits/file-permissions, etc.. About 1/4 of all Apache directives cannot be used inside an .htaccess file (also known as a per-directory context config). The Apache Developers are well-regarded throughout the world as being among some of the best programmers, ever. To enable a disallowed directive inside a .htaccess file would require modifying the source code and re-compiling the server (which they allow and encourage if you are the owner/admin). Here’s a taste of that famous Apache source code that builds the directives allowed in .htaccess file context, the key that tells whether its enabled in .htaccess context is the DIR_CMD_PERMS and then the OR_FILEINFO, which means a directive is enabled dependent on the AllowOverride directive that is only allowed in the main config. First Apache 1.3.0, then Apache 2.2.10

//mod_autoindex
"AddIcon", add_icon, BY_PATH, DIR_CMD_PERMS, ITERATE2, "an icon URL followed by one or more filenames"
"AddIconByType", add_icon, BY_TYPE, DIR_CMD_PERMS, ITERATE2, "an icon URL followed by one or more MIME types"
"AddIconByEncoding", add_icon, BY_ENCODING, DIR_CMD_PERMS, ITERATE2, "an icon URL followed by one or more content encodings"
"AddAlt", add_alt, BY_PATH, DIR_CMD_PERMS, ITERATE2, "alternate descriptive text followed by one or more filenames"
"AddAltByType", add_alt, BY_TYPE, DIR_CMD_PERMS, ITERATE2, "alternate descriptive text followed by one or more MIME types"
"AddAltByEncoding", add_alt, BY_ENCODING, DIR_CMD_PERMS, ITERATE2, "alternate descriptive text followed by one or more content encodings"
"IndexOptions", add_opts, NULL, DIR_CMD_PERMS, RAW_ARGS, "one or more index options"
"IndexIgnore", add_ignore, NULL, DIR_CMD_PERMS, ITERATE, "one or more file extensions"
"AddDescription", add_desc, BY_PATH, DIR_CMD_PERMS, ITERATE2, "Descriptive text followed by one or more filenames"
"HeaderName", add_header, NULL, DIR_CMD_PERMS, TAKE1, "a filename"
"ReadmeName", add_readme, NULL, DIR_CMD_PERMS, TAKE1, "a filename"
"FancyIndexing", fancy_indexing, NULL, DIR_CMD_PERMS, FLAG, "Limited to 'on' or 'off' (superseded by IndexOptions FancyIndexing)"
"DefaultIcon", ap_set_string_slot, (void *) XtOffsetOf(autoindex_config_rec, default_icon), DIR_CMD_PERMS, TAKE1, "an icon URL"
// mod_rewrite
AP_INIT_FLAG( "RewriteEngine", cmd_rewriteengine, NULL, OR_FILEINFO,|"On or Off to enable or disable (default)
AP_INIT_ITERATE( "RewriteOptions", cmd_rewriteoptions, NULL, OR_FILEINFO,|"List of option strings to set")
AP_INIT_TAKE1( "RewriteBase", cmd_rewritebase, NULL, OR_FILEINFO,|"the base URL of the per-directory context")
AP_INIT_RAW_ARGS("RewriteCond", cmd_rewritecond, NULL, OR_FILEINFO,|"an input string and a to be applied regexp-pattern")
AP_INIT_RAW_ARGS("RewriteRule", cmd_rewriterule, NULL, OR_FILEINFO,|"an URL-applied regexp-pattern and a substitution URL")
AP_INIT_TAKE2( "RewriteMap", cmd_rewritemap, NULL, RSRC_CONF,|"a mapname and a filename")
AP_INIT_TAKE1( "RewriteLock", cmd_rewritelock, NULL, RSRC_CONF,|"the filename of a lockfile used for inter-process "|"synchronization")
AP_INIT_TAKE1( "RewriteLog", cmd_rewritelog, NULL, RSRC_CONF,|"the filename of the rewriting logfile")
AP_INIT_TAKE1( "RewriteLogLevel", cmd_rewriteloglevel, NULL, RSRC_CONF,|"the level of the rewriting logfile verbosity "|"(0=none, 1=std, .., 9=max)
AP_INIT_TAKE1( "RewriteLog", fake_rewritelog, NULL, RSRC_CONF,|"[DISABLED] the filename of the rewriting logfile")
AP_INIT_TAKE1( "RewriteLogLevel", fake_rewritelog, NULL, RSRC_CONF,|"[DISABLED] the level of the rewriting logfile verbosity")

Htaccess Directives

Don’t ask why, but I personally downloaded each major/beta release of the Apache HTTPD source code from version 1.3.0 to version 2.2.10 (all 63 Apache versions!), then I configured and compiled each version for a custom HTTPD installation built from source. This allowed me to find every directive allowed in .htaccess files for each particular version, which has never been done before, or since. YES! I think that is so cool..

An .htaccess directive is basically a command that is specific to a module or builtin to the core that performs a specific task or sets a specific setting for how Apache serves your WebSite. Directives placed in Htaccess files apply to the directory they are in, and all sub-directories. Here’s the 3 top links (official Apache Docs) you will repeatedly use, bookmark/print/save them.

htaccess Context Legend

  1. Terms Used to Describe Directives
  2. Official List of Apache Directives
  3. Directive Quick-Reference — with Context

Main Server Config Examples

Still with me? Now lets take a look at some htaccess examples to get a feel for the syntax and some general ideas at the capabilities. Some of the best examples for .htaccess files are included with Apache for main server config files, so lets take a quick look at a couple of them on our way down to the actual .htaccess examples further down the page (this site has thousands, take your time). As you can see, the basic syntax is a line starting with # is a comment, everything else are directives followed by the directive argument.

httpd-multilang-errordoc.conf: The configuration below implements multi-language error documents through content-negotiation

Options IncludesNoExec
AddOutputFilter Includes html
AddHandler type-map var
LanguagePriority en cs de es fr it ja ko nl pl pt-br ro sv tr
ForceLanguagePriority Prefer Fallback
ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var

httpd-manual.conf: Provide local access to the server documentation on your server

SetEnvIf Request_URI ^/manual/(de|en|es|fr|ja|ko|pt-br|ru|tr)/ prefer-language=$1
RedirectMatch 301 ^/manual(?:/(de|en|es|fr|ja|ko|pt-br|ru|tr)){2,}(/.*)?$ /manual/$1$2
LanguagePriority en de es fr ja ko pt-br ru tr
ForceLanguagePriority Prefer Fallback

httpd-languages.conf: Settings for hosting different languages.

DefaultLanguage en
AddLanguage ca .ca
# Just list the languages in decreasing order of preference.
LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv tr zh-CN zh-TW
# Commonly used filename extensions to character sets.
AddCharset us-ascii.ascii .us-ascii
AddCharset ISO-8859-1 .iso8859-1 .latin1

httpd-autoindex.conf: Directives controlling the display of server-generated directory listings.

# IndexOptions: Controls the appearance of server-generated directory listings.
IndexOptions FancyIndexing HTMLTable VersionSort
# AddIcon* directives tell the server which icon to show for different files or filename extensions.
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
AddIconByType (TXT,/icons/text.gif) text/*
AddIcon /icons/folder.gif ^^DIRECTORY^^
# DefaultIcon is which icon to show for files which do not have an icon explicitly set.
DefaultIcon /icons/unknown.gif
# AddDescription allows you to place a short description after a file in server-generated indexes.
AddDescription "GZIP compressed document" .gz
# ReadmeName is the name of the README file the server will look for by default, and append to directory listings.
ReadmeName README.html
# HeaderName is the name of a file which should be prepended to directory indexes.
HeaderName HEADER.html

Here are the rest of them if you wanna take a look. (httpd-mpm.conf, httpd-default.conf, httpd-ssl.conf, httpd-info.conf, httpd-vhosts.conf, httpd-dav.conf)


Example .htaccess Files

Here are some samples and examples taken from different .htaccess files I’ve used over the years. Specific solutions are farther down on this page and throughout the site.

# Set the Time Zone of your Server
SetEnv TZ America/Indianapolis
# ServerAdmin: This address appears on some server-generated pages, such as error documents.
SetEnv SERVER_ADMIN webmaster@askapache.com
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
Options -ExecCGI -MultiViews -Includes -Indexes FollowSymLinks
# DirectoryIndex: sets the file that Apache will serve if a directory is requested.
DirectoryIndex index.html index.php /index.php
#
# Action lets you define media types that will execute a script whenever
# a matching file is called. This eliminates the need for repeated URL
# pathnames for oft-used CGI file processors.
# Format: Action media/type /cgi-script/location
# Format: Action handler-name /cgi-script/location
#
Action php5-cgi /bin/php.cgi
#
# AddHandler allows you to map certain file extensions to "handlers":
# actions unrelated to filetype. These can be either built into the server
# or added with the Action directive (see below)
#
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
AddHandler php-cgi .php .inc
# Commonly used filename extensions to character sets.
AddDefaultCharset UTF-8
# AddType allows you to add to or override the MIME configuration
AddType 'application/rdf+xml; charset=UTF-8' .rdf
AddType 'application/xhtml+xml; charset=UTF-8' .xhtml
AddType 'application/xhtml+xml; charset=UTF-8' .xhtml.gz
AddType 'text/html; charset=UTF-8' .html
AddType 'text/html; charset=UTF-8' .html.gz
AddType application/octet-stream .rar .chm .bz2 .tgz .msi .pdf .exe
AddType application/vnd.ms-excel .csv
AddType application/x-httpd-php-source .phps
AddType application/x-pilot .prc .pdb
AddType application/x-shockwave-flash .swf
AddType application/xrds+xml .xrdf
AddType text/plain .ini .sh .bsh .bash .awk .nawk .gawk .csh .var .c .in .h .asc .md5 .sha .sha1
AddType video/x-flv .flv
# AddEncoding allows you to have certain browsers uncompress information on the fly. Note: Not all browsers support this.
AddEncoding x-compress .Z
AddEncoding x-gzip .gz .tgz
# DefaultType: the default MIME type the server will use for a document.
DefaultType text/html
#
# Optionally add a line containing the server version and virtual host
# name to server-generated pages (internal error documents, FTP directory
# listings, mod_status and mod_info output etc., but not CGI generated
# documents or custom error documents).
# Set to "EMail" to also include a mailto: link to the ServerAdmin.
# Set to one of: On | Off | EMail
#
ServerSignature Off
## MAIN DEFAULTS
Options +ExecCGI -Indexes
DirectoryIndex index.html index.htm index.php
DefaultLanguage en-US
AddDefaultCharset UTF-8
ServerSignature Off
## ENVIRONMENT VARIABLES
SetEnv PHPRC /webroot/includes
SetEnv TZ America/Indianapolis
SetEnv SERVER_ADMIN webmaster@askapache.com
## MIME TYPES
AddType video/x-flv .flv
AddType application/x-shockwave-flash .swf
AddType image/x-icon .ico
## FORCE FILE TO DOWNLOAD INSTEAD OF APPEAR IN BROWSER
# http://www.htaccesselite.com/addtype-addhandler-action-vf6.html
AddType application/octet-stream .mov .mp3 .zip
## ERRORDOCUMENTS
# http://askapache.com/htaccess/apache-status-code-headers-errordocument.html
ErrorDocument 400 /error-400/
ErrorDocument 401 /error-401/
ErrorDocument 402 /error-402/
ErrorDocument 403 /error-403/
ErrorDocument 404 /error-404/
ErrorDocument 405 /error-405/
ErrorDocument 406 /error-406/
ErrorDocument 407 /error-407/
ErrorDocument 408 /error-408/
ErrorDocument 409 /error-409/
ErrorDocument 410 /error-410/
ErrorDocument 411 /error-411/
ErrorDocument 412 /error-412/
ErrorDocument 413 /error-413/
ErrorDocument 414 /error-414/
ErrorDocument 415 /error-415/
ErrorDocument 416 /error-416/
ErrorDocument 417 /error-417/
ErrorDocument 418 /error-418/
ErrorDocument 419 /error-419/
ErrorDocument 420 /error-420/
ErrorDocument 421 /error-421/
ErrorDocument 422 /error-422/
ErrorDocument 423 /error-423/
ErrorDocument 424 /error-424/
ErrorDocument 425 /error-425/
ErrorDocument 426 /error-426/
ErrorDocument 500 /error-500/
ErrorDocument 501 /error-501/
ErrorDocument 502 /error-502/
ErrorDocument 503 /error-503/
ErrorDocument 504 /error-504/
ErrorDocument 505 /error-505/
ErrorDocument 506 /error-506/
ErrorDocument 507 /error-507/
ErrorDocument 508 /error-508/
ErrorDocument 509 /error-509/
ErrorDocument 510 /error-510/
#
# Handlers be builtin, included in a module, or added with Action directive
# default-handler: default, handles static content (core)
# send-as-is: Send file with HTTP headers (mod_asis)
# cgi-script: treat file as CGI script (mod_cgi)
# imap-file: Parse as an imagemap rule file (mod_imap)
# server-info: Get server config info (mod_info)
# server-status: Get server status report (mod_status)
# type-map: type map file for content negotiation (mod_negotiation)
# fastcgi-script: treat file as fastcgi script (mod_fastcgi)
#
# http://www.askapache.com/php/custom-phpini-tips-and-tricks.html
## PARSE AS CGI
AddHandler cgi-script .cgi .pl .spl
## RUN PHP AS APACHE MODULE
AddHandler application/x-httpd-php .php .htm
## RUN PHP AS CGI
AddHandler php-cgi .php .htm
## CGI PHP WRAPPER FOR CUSTOM PHP.INI
AddHandler phpini-cgi .php .htm
Action phpini-cgi /cgi-bin/php5-custom-ini.cgi
## FAST-CGI SETUP WITH PHP-CGI WRAPPER FOR CUSTOM PHP.INI
AddHandler fastcgi-script .fcgi
AddHandler php-cgi .php .htm
Action php-cgi /cgi-bin/php5-wrapper.fcgi
## CUSTOM PHP CGI BINARY SETUP
AddHandler php-cgi .php .htm
Action php-cgi /cgi-bin/php.cgi
## PROCESS SPECIFIC FILETYPES WITH CGI-SCRIPT
Action image/gif /cgi-bin/img-create.cgi
## CREATE CUSTOM HANDLER FOR SPECIFIC FILE EXTENSIONS
AddHandler custom-processor .ssp
Action custom-processor /cgi-bin/myprocessor.cgi
### HEADER CACHING
# http://www.askapache.com/htaccess/speed-up-sites-with-htaccess-caching.html

Header set Cache-Control "max-age=2592000"


Header set Cache-Control "max-age=604800"


Header set Cache-Control "max-age=600"


Header unset Cache-Control

## ALTERNATE EXPIRES CACHING
# htaccesselite.com/d/use-htaccess-to-speed-up-your-site-discussion-vt67.html
ExpiresActive On
ExpiresDefault A604800
ExpiresByType image/x-icon A2592000
ExpiresByType application/x-javascript A2592000
ExpiresByType text/css A2592000
ExpiresByType text/html A300

ExpiresActive Off

## META HTTP-EQUIV REPLACEMENTS

Header set imagetoolbar "no"

Here are some default MOD_REWRITE code examples.

## REWRITE DEFAULTS
RewriteEngine On
RewriteBase /
## REQUIRE SUBDOMAIN
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^subdomain\.askapache\.com$ [NC]
RewriteRule ^/(.*)$ http://subdomain.askapache.com/$1 [L,R=301]
## SEO REWRITES
RewriteRule ^(.*)/ve/(.*)$ $1/voluntary-employee/$2 [L,R=301]
RewriteRule ^(.*)/hsa/(.*)$ $1/health-saving-account/$2 [L,R=301]
## WORDPRESS
RewriteCond %{REQUEST_FILENAME} !-f # Existing File
RewriteCond %{REQUEST_FILENAME} !-d # Existing Directory
RewriteRule . /index.php [L]
## ALTERNATIVE ANTI-HOTLINKING
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(subdomain\.)?askapache.com/.*$ [NC]
RewriteRule ^.*\.(bmp|tif|gif|jpg|jpeg|jpe|png)$ - [F]
## REDIRECT HOTLINKERS
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(subdomain\.)?askapache.com/.*$ [NC]
RewriteRule ^.*\.(bmp|tif|gif|jpg|jpeg|jpe|png)$ http://google.com [R]
## DENY REQUEST BASED ON REQUEST METHOD
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK|OPTIONS|HEAD)$ [NC]
RewriteRule ^.*$ - [F]
## REDIRECT UPLOADS
RewriteCond %{REQUEST_METHOD} ^(PUT|POST)$ [NC]
RewriteRule ^(.*)$ /cgi-bin/form-upload-processor.cgi?p=$1 [L,QSA]
## REQUIRE SSL EVEN WHEN MOD_SSL IS NOT LOADED
RewriteCond %{HTTPS} !=on [NC]
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
### ALTERNATATIVE TO USING ERRORDOCUMENT
# http://www.htaccesselite.com/d/htaccess-errordocument-examples-vt11.html
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ /error.php [L]
## SEO REDIRECTS
Redirect 301 /2006/oldfile.html http://subdomain.askapache.com/newfile.html
RedirectMatch 301 /o/(.*)$ http://subdomain.askapache.com/s/dl/$1

Examples of protecting your files and securing with password protection.

#
# Require (user|group|valid-user) (username|groupname)
#
## BASIC PASSWORD PROTECTION
AuthType basic
AuthName "prompt"
AuthUserFile /.htpasswd
AuthGroupFile /dev/null
Require valid-user
## ALLOW FROM IP OR VALID PASSWORD
Require valid-user
Allow from 192.168.1.23
Satisfy Any
## PROTECT FILES

Order Allow,Deny
Deny from all

## PREVENT HOTLINKING
SetEnvIfNoCase Referer "^http://subdomain.askapache.com/" good
SetEnvIfNoCase Referer "^$" good

Order Deny,Allow
Deny from all
Allow from env=good
ErrorDocument 403 http://www.google.com/intl/en_ALL/images/logo.gif
ErrorDocument 403 /images/you_bad_hotlinker.gif

## LIMIT UPLOAD FILE SIZE TO PROTECT AGAINST DOS ATTACK
#bytes, 0-2147483647(2GB)
LimitRequestBody 10240000
## MOST SECURE WAY TO REQUIRE SSL
# http://www.askapache.com/htaccess/apache-ssl-in-htaccess-examples.html
SSLOptions +StrictRequire
SSLRequireSSL
SSLRequire %{HTTP_HOST} eq "askapache.com"
ErrorDocument 403 https://askapache.com
## COMBINED DEVELOPER HTACCESS CODE-USE THIS

Header set Cache-Control "max-age=5"

AuthType basic
AuthName "Ooops! Temporarily Under Construction..."
AuthUserFile /.htpasswd
AuthGroupFile /dev/null
Require valid-user # password prompt for everyone else
Order Deny,Allow
Deny from all
Allow from 192.168.64.5 # Your, the developers IP address
Allow from w3.org # css/xhtml check jigsaw.w3.org/css-validator/
Allow from googlebot.com # Allows google to crawl your pages
Satisfy Any # no password required if host/ip is Allowed
## DONT HAVE TO EMPTY CACHE OR RELOAD TO SEE CHANGES
ExpiresDefault A5 #If using mod_expires

Header set Cache-Control "max-age=5"

## ALLOW ACCESS WITH PASSWORD OR NO PASSWORD FOR SPECIFIC IP/HOSTS
AuthType basic
AuthName "Ooops! Temporarily Under Construction..."
AuthUserFile /.htpasswd
AuthGroupFile /dev/null
Require valid-user # password prompt for everyone else
Order Deny,Allow
Deny from all
Allow from 192.168.64.5 # Your, the developers IP address
Allow from w3.org # css/xhtml check jigsaw.w3.org/css-validator/
Allow from googlebot.com # Allows google to crawl your pages
Satisfy Any # no password required if host/ip is Allowed

Example .htaccess Code Snippets

Here are some specific examples, this is the most popular section of this page. Updated frequently.

Redirect Everyone Except IP address to alternate page

ErrorDocument 403 http://www.yahoo.com/
Order deny,allow
Deny from all
Allow from 208.113.134.190

When developing sites

This lets google crawl the page, lets me access without a password, and lets my client access the page WITH a password. It also allows for XHTML and CSS validation! (w3.org)

AuthName "Under Development"
AuthUserFile /home/sitename.com/.htpasswd
AuthType basic
Require valid-user
Order deny,allow
Deny from all
Allow from 208.113.134.190 w3.org htmlhelp.com googlebot.com
Satisfy Any

Fix double-login prompt

Redirect non-https requests to https server and ensure that .htpasswd authorization can only be entered across HTTPS

SSLOptions +StrictRequire
SSLRequireSSL
SSLRequire %{HTTP_HOST} eq "askapache.com"
ErrorDocument 403 https://askapache.com

Set Timezone of the Server (GMT)

SetEnv TZ America/Indianapolis

Administrator Email for ErrorDocument

SetEnv SERVER_ADMIN webmaster@google.com

ServerSignature for ErrorDocument

ServerSignature off | on | email

Charset and Language headers

Article: Setting Charset in htaccess, and article by Richard Ishida

AddDefaultCharset UTF-8
DefaultLanguage en-US

Disallow Script Execution

Options -ExecCGI
AddHandler cgi-script .php .pl .py .jsp .asp .htm .shtml .sh .cgi

Deny Request Methods

RewriteCond %{REQUEST_METHOD} !^(GET|HEAD|OPTIONS|POST|PUT)
RewriteRule .* - [F]

Force “File Save As” Prompt

AddType application/octet-stream .avi .mpg .mov .pdf .xls .mp4

Show CGI Source Code

RemoveHandler cgi-script .pl .py .cgi
AddType text/plain .pl .py .cgi

Serve all .pdf files on your site using .htaccess and mod_rewrite with the php script.

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.+)\.pdf$ /cgi-bin/pdf.php?file=$1 [L,NC,QSA]

Rewrite to www

RewriteCond %{REQUEST_URI} !^/(robots\.txt|favicon\.ico|sitemap\.xml)$
RewriteCond %{HTTP_HOST} !^www\.askapache\.com$ [NC]
RewriteRule ^(.*)$ http://www.askapache.com/$1 [R=301,L]

Rewrite to www dynamically

RewriteCond %{REQUEST_URI} !^/robots\.txt$ [NC]
RewriteCond %{HTTP_HOST} !^www\.[a-z-]+\.[a-z]{2,6} [NC]
RewriteCond %{HTTP_HOST} ([a-z-]+\.[a-z]{2,6})$ [NC]
RewriteRule ^/(.*)$ http://%1/$1 [R=301,L]

301 Redirect Old File

Redirect 301 /old/file.html http://www.askapache.com/new/file.html

301 Redirect Entire Directory

RedirectMatch 301 /blog(.*) http://www.askapache.com/$1

Protecting your php.cgi


Order Deny,Allow
Deny from All
Allow from env=REDIRECT_STATUS

Set Cookie based on Request

This code sends the Set-Cookie header to create a cookie on the client with the value of a matching item in 2nd parantheses.

RewriteEngine On
RewriteBase /
RewriteRule ^(.*)(de|es|fr|it|ja|ru|en)/$ - [co=lang:$2:.askapache.com:7200:/]

Set Cookie with env variable

Header set Set-Cookie "language=%{lang}e; path=/;" env=lang

Custom ErrorDocuments

ErrorDocument 100 /error/100_CONTINUE.html
ErrorDocument 101 /error/101_SWITCHING_PROTOCOLS.html
ErrorDocument 102 /error/102_PROCESSING.html
ErrorDocument 200 /error/200_OK.html
ErrorDocument 201 /error/201_CREATED.html
ErrorDocument 202 /error/202_ACCEPTED.html
ErrorDocument 203 /error/203_NON_AUTHORITATIVE.html
ErrorDocument 204 /error/204_NO_CONTENT.html
ErrorDocument 205 /error/205_RESET_CONTENT.html
ErrorDocument 206 /error/206_PARTIAL_CONTENT.html
ErrorDocument 207 /error/207_MULTI_STATUS.html
ErrorDocument 300 /error/300_MULTIPLE_CHOICES.html
ErrorDocument 301 /error/301_MOVED_PERMANENTLY.html
ErrorDocument 302 /error/302_MOVED_TEMPORARILY.html
ErrorDocument 303 /error/303_SEE_OTHER.html
ErrorDocument 304 /error/304_NOT_MODIFIED.html
ErrorDocument 305 /error/305_USE_PROXY.html
ErrorDocument 307 /error/307_TEMPORARY_REDIRECT.html
ErrorDocument 400 /error/400_BAD_REQUEST.html
ErrorDocument 401 /error/401_UNAUTHORIZED.html
ErrorDocument 402 /error/402_PAYMENT_REQUIRED.html
ErrorDocument 403 /error/403_FORBIDDEN.html
ErrorDocument 404 /error/404_NOT_FOUND.html
ErrorDocument 405 /error/405_METHOD_NOT_ALLOWED.html
ErrorDocument 406 /error/406_NOT_ACCEPTABLE.html
ErrorDocument 407 /error/407_PROXY_AUTHENTICATION_REQUIRED.html
ErrorDocument 408 /error/408_REQUEST_TIME_OUT.html
ErrorDocument 409 /error/409_CONFLICT.html
ErrorDocument 410 /error/410_GONE.html
ErrorDocument 411 /error/411_LENGTH_REQUIRED.html
ErrorDocument 412 /error/412_PRECONDITION_FAILED.html
ErrorDocument 413 /error/413_REQUEST_ENTITY_TOO_LARGE.html
ErrorDocument 414 /error/414_REQUEST_URI_TOO_LARGE.html
ErrorDocument 415 /error/415_UNSUPPORTED_MEDIA_TYPE.html
ErrorDocument 416 /error/416_RANGE_NOT_SATISFIABLE.html
ErrorDocument 417 /error/417_EXPECTATION_FAILED.html
ErrorDocument 422 /error/422_UNPROCESSABLE_ENTITY.html
ErrorDocument 423 /error/423_LOCKED.html
ErrorDocument 424 /error/424_FAILED_DEPENDENCY.html
ErrorDocument 426 /error/426_UPGRADE_REQUIRED.html
ErrorDocument 500 /error/500_INTERNAL_SERVER_ERROR.html
ErrorDocument 501 /error/501_NOT_IMPLEMENTED.html
ErrorDocument 502 /error/502_BAD_GATEWAY.html
ErrorDocument 503 /error/503_SERVICE_UNAVAILABLE.html
ErrorDocument 504 /error/504_GATEWAY_TIME_OUT.html
ErrorDocument 505 /error/505_VERSION_NOT_SUPPORTED.html
ErrorDocument 506 /error/506_VARIANT_ALSO_VARIES.html
ErrorDocument 507 /error/507_INSUFFICIENT_STORAGE.html
ErrorDocument 510 /error/510_NOT_EXTENDED.html

Implementing a Caching Scheme with .htaccess

# year

Header set Cache-Control "public"
Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT"
Header unset Last-Modified

#2 hours

Header set Cache-Control "max-age=7200, must-revalidate"


SetOutputFilter DEFLATE
Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT"

Password Protect single file


AuthName "Prompt"
AuthType Basic
AuthUserFile /home/askapache.com/.htpasswd
Require valid-user

Password Protect multiple files


AuthName "Development"
AuthUserFile /.htpasswd
AuthType basic
Require valid-user

Send Custom Headers

Header set P3P "policyref=\"http://www.askapache.com/w3c/p3p.xml\""
Header set X-Pingback "http://www.askapache.com/xmlrpc.php"
Header set Content-Language "en-US"
Header set Vary "Accept-Encoding"

Blocking based on User-Agent Header

SetEnvIfNoCase ^User-Agent$ .*(craftbot|download|extract|stripper|sucker|ninja|clshttp|webspider|leacher|collector|grabber|webpictures) HTTP_SAFE_BADBOT
SetEnvIfNoCase ^User-Agent$ .*(libwww-perl|aesop_com_spiderman) HTTP_SAFE_BADBOT
Deny from env=HTTP_SAFE_BADBOT

Blocking with RewriteCond

RewriteCond %{HTTP_USER_AGENT} ^.*(craftbot|download|extract|stripper|sucker|ninja|clshttp|webspider|leacher|collector|grabber|webpictures).*$ [NC]
RewriteRule . - [F,L]

.htaccess for mod_php

SetEnv PHPRC /location/todir/containing/phpinifile

.htaccess for php as cgi

AddHandler php-cgi .php .htm
Action php-cgi /cgi-bin/php5.cgi

Shell wrapper for custom php.ini

#!/bin/sh
export PHP_FCGI_CHILDREN=3
exec php5.cgi -c /abs/php5/php.ini

Add values from HTTP Headers

SetEnvIfNoCase ^If-Modified-Since$ "(.+)" HTTP_IF_MODIFIED_SINCE=$1
SetEnvIfNoCase ^If-None-Match$ "(.+)" HTTP_IF_NONE_MATCH=$1
SetEnvIfNoCase ^Cache-Control$ "(.+)" HTTP_CACHE_CONTROL=$1
SetEnvIfNoCase ^Connection$ "(.+)" HTTP_CONNECTION=$1
SetEnvIfNoCase ^Keep-Alive$ "(.+)" HTTP_KEEP_ALIVE=$1
SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
SetEnvIfNoCase ^Cookie$ "(.+)" HTTP_MY_COOKIE=$1

Stop hotlinking

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?askapache.com/.*$ [NC]
RewriteRule \.(gif|jpg|swf|flv|png)$ http://www.askapache.com/feed.gif [R=302,L]

Turn logging off for IP

SecFilterSelective REMOTE_ADDR "208\.113\.183\.103" "nolog,noauditlog,pass"

Turn logging on for IP

SecFilterSelective REMOTE_ADDR "!^208\.113\.183\.103" "nolog,noauditlog,pass"
SecFilterSelective REMOTE_ADDR "208\.113\.183\.103" "log,auditlog,pass"

Advanced Mod_Rewrite Examples

Here are some specific examples taken mostly from my WordPress Password Protection plugin, that also does alot more than password protection as you can see from the following mod_rewrite examples. These are a few of the mod_rewrite uses that BlogSecurity declared pushed the boundaries of Mod_Rewrite! Some of these snippets are quite exotic and unlike anything you may have seen before, also only for those who understand them as they can kill a website pretty quick.

Directory Protection

Enable the DirectoryIndex Protection, preventing directory index listings and defaulting. [Disable]

Options -Indexes
DirectoryIndex index.html index.php /index.php

Password Protect wp-login.php

Requires a valid user/pass to access the login page[401]


Order Deny,Allow
Deny from All
Satisfy Any
AuthName "Protected By AskApache"
AuthUserFile /home/askapache.com/.htpasswda1
AuthType Basic
Require valid-user

Password Protect wp-admin

Requires a valid user/pass to access any non-static (css, js, images) file in this directory.[401]

Options -ExecCGI -Indexes +FollowSymLinks -Includes
DirectoryIndex index.php /index.php
Order Deny,Allow
Deny from All
Satisfy Any
AuthName "Protected By AskApache"
AuthUserFile /home/askapache.com/.htpasswda1
AuthType Basic
Require valid-user

Allow from All



SecFilterEngine Off

Allow from All

Protect wp-content

Denies any Direct request for files ending in .php with a 403 Forbidden.. May break plugins/themes [401]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /wp-content/.*$ [NC]
RewriteCond %{REQUEST_FILENAME} !^.+flexible-upload-wp25js.php$
RewriteCond %{REQUEST_FILENAME} ^.+\.(php|html|htm|txt)$
RewriteRule .* - [F,NS,L]

Protect wp-includes

Denies any Direct request for files ending in .php with a 403 Forbidden.. May break plugins/themes [403]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /wp-includes/.*$ [NC]
RewriteCond %{THE_REQUEST} !^[A-Z]{3,9}\ /wp-includes/js/.+/.+\ HTTP/ [NC]
RewriteCond %{REQUEST_FILENAME} ^.+\.php$
RewriteRule .* - [F,NS,L]

Common Exploits

Block common exploit requests with 403 Forbidden. These can help alot, may break some plugins. [403]

RewriteCond %{REQUEST_URI} !^/(wp-login.php|wp-admin/|wp-content/plugins/|wp-includes/).* [NC]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ ///.*\ HTTP/ [NC,OR]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*\?\=?(http|ftp|ssl|https):/.*\ HTTP/ [NC,OR]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*\?\?.*\ HTTP/ [NC,OR]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*\.(asp|ini|dll).*\ HTTP/ [NC,OR]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*\.(htpasswd|htaccess|aahtpasswd).*\ HTTP/ [NC]
RewriteRule .* - [F,NS,L]

Stop Hotlinking

Denies any request for static files (images, css, etc) if referrer is not local site or empty. [403]

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{REQUEST_URI} !^/(wp-login.php|wp-admin/|wp-content/plugins/|wp-includes/).* [NC]
RewriteCond %{HTTP_REFERER} !^http://www.askapache.com.*$ [NC]
RewriteRule \.(ico|pdf|flv|jpg|jpeg|mp3|mpg|mp4|mov|wav|wmv|png|gif|swf|css|js)$ - [F,NS,L]

Safe Request Methods

Denies any request not using GET,PROPFIND,POST,OPTIONS,PUT,HEAD[403]

RewriteCond %{REQUEST_METHOD} !^(GET|HEAD|POST|PROPFIND|OPTIONS|PUT)$ [NC]
RewriteRule .* - [F,NS,L]

Forbid Proxies

Denies any POST Request using a Proxy Server. Can still access site, but not comment. See Perishable Press [403]

RewriteCond %{REQUEST_METHOD} =POST
RewriteCond %{HTTP:VIA}%{HTTP:FORWARDED}%{HTTP:USERAGENT_VIA}%{HTTP:X_FORWARDED_FOR}%{HTTP:PROXY_CONNECTION} !^$ [OR]
RewriteCond %{HTTP:XPROXY_CONNECTION}%{HTTP:HTTP_PC_REMOTE_ADDR}%{HTTP:HTTP_CLIENT_IP} !^$
RewriteCond %{REQUEST_URI} !^/(wp-login.php|wp-admin/|wp-content/plugins/|wp-includes/).* [NC]
RewriteRule .* - [F,NS,L]

Real wp-comments-post.php

Denies any POST attempt made to a non-existing wp-comments-post.php[403]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*/wp-comments-post\.php.*\ HTTP/ [NC]
RewriteRule .* - [F,NS,L]

HTTP PROTOCOL

Denies any badly formed HTTP PROTOCOL in the request, 0.9, 1.0, and 1.1 only[403]

RewriteCond %{THE_REQUEST} !^[A-Z]{3,9}\ .+\ HTTP/(0\.9|1\.0|1\.1) [NC]
RewriteRule .* - [F,NS,L]

SPECIFY CHARACTERS

Denies any request for a url containing characters other than “a-zA-Z0-9.+/-?=&” – REALLY helps but may break your site depending on your links. [403]

RewriteCond %{REQUEST_URI} !^/(wp-login.php|wp-admin/|wp-content/plugins/|wp-includes/).* [NC]
RewriteCond %{THE_REQUEST} !^[A-Z]{3,9}\ [a-zA-Z0-9\.\+_/\-\?\=\&]+\ HTTP/ [NC]
RewriteRule .* - [F,NS,L]

BAD Content Length

Denies any POST request that doesnt have a Content-Length Header[403]

RewriteCond %{REQUEST_METHOD} =POST
RewriteCond %{HTTP:Content-Length} ^$
RewriteCond %{REQUEST_URI} !^/(wp-admin/|wp-content/plugins/|wp-includes/).* [NC]
RewriteRule .* - [F,NS,L]

BAD Content Type

Denies any POST request with a content type other than application/x-www-form-urlencoded|multipart/form-data[403]

RewriteCond %{REQUEST_METHOD} =POST
RewriteCond %{HTTP:Content-Type} !^(application/x-www-form-urlencoded|multipart/form-data.*(boundary.*)?)$ [NC]
RewriteCond %{REQUEST_URI} !^/(wp-login.php|wp-admin/|wp-content/plugins/|wp-includes/).* [NC]
RewriteRule .* - [F,NS,L]

NO HOST:

Denies requests that dont contain a HTTP HOST Header.[403]

RewriteCond %{REQUEST_URI} !^/(wp-login.php|wp-admin/|wp-content/plugins/|wp-includes/).* [NC]
RewriteCond %{HTTP_HOST} ^$
RewriteRule .* - [F,NS,L]

Bogus Graphics Exploit

Denies obvious exploit using bogus graphics[403]

RewriteCond %{HTTP:Content-Disposition} \.php [NC]
RewriteCond %{HTTP:Content-Type} image/.+ [NC]
RewriteRule .* - [F,NS,L]

No UserAgent, No Post

Denies POST requests by blank user-agents. May prevent a small number of visitors from POSTING. [403]

RewriteCond %{REQUEST_METHOD} =POST
RewriteCond %{HTTP_USER_AGENT} ^-?$
RewriteCond %{REQUEST_URI} !^/(wp-login.php|wp-admin/|wp-content/plugins/|wp-includes/).* [NC]
RewriteRule .* - [F,NS,L]

No Referer, No Comment

Denies any comment attempt with a blank HTTP_REFERER field, highly indicative of spam. May prevent some visitors from POSTING. [403]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*/wp-comments-post\.php.*\ HTTP/ [NC]
RewriteCond %{HTTP_REFERER} ^-?$
RewriteRule .* - [F,NS,L]

Trackback Spam

Denies obvious trackback spam. See Holy Shmoly! [403]

RewriteCond %{REQUEST_METHOD} =POST
RewriteCond %{HTTP_USER_AGENT} ^.*(opera|mozilla|firefox|msie|safari).*$ [NC]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.+/trackback/?\ HTTP/ [NC]
RewriteRule .* - [F,NS,L]

Map all URIs except those corresponding to existing files to a handler

RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteRule . /script.php

Map any request to a handler

In the case where all URIs should be sent to the same place (including potentially requests for static content) the method to use depends on the type of the handler. For php scripts, use:
For other handlers such as php scripts, use:

RewriteEngine On
RewriteCond %{REQUEST_URI} !=/script.php
RewriteRule .* /script.php

And for CGI scripts:

ScriptAliasMatch .* /var/www/script.cgi

Map URIs corresponding to existing files to a handler instead

RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f
RewriteCond %{REQUEST_URI} !=/script.php
RewriteRule .* /script.php

If the existing files you wish to have handled by your script have a common set of file extensions distinct from that of the hander, you can bypass mod_rewrite and use instead mod_actions. Let’s say you want all .html and .tpl files to be dealt with by your script:

Action foo-action /script.php
AddHandler foo-action html tpl

Deny access if var=val contains the string foo.

RewriteCond %{QUERY_STRING} foo
RewriteRule ^/url - [F]

Removing the Query String

RewriteRule ^/url /url?

Adding to the Query String

Keep the existing query string using the Query String Append flag, but add var=val to the end.

RewriteRule ^/url /url?var=val [QSA]

Rewriting For Certain Query Strings

Rewrite URLs like http://askapache.com/url1?var=val to http://askapache.com/url2?var=val but don’t rewrite if val isn’t present.

RewriteCond %{QUERY_STRING} val
RewriteRule ^/url1 /url2

Modifying the Query String

Change any single instance of val in the query string to other_val when accessing /path. Note that %1 and %2 are back-references to the matched part of the regular expression in the previous RewriteCond.

RewriteCond %{QUERY_STRING} ^(.*)val(.*)$
RewriteRule /path /path?%1other_val%2

Creative Costum Error Pages You May Like

0 yorum
We all try to find the best costum error pages for our servers or sites, here are clever peoples who found creative designs for costum error pages....

124

222

319

417

518

619

78

87

98

103

1110

125

132

142

152

162

172

182

192

202

2110

223

232

242

252

262

272

282

292

302

3110

322

332

342

352

362

372

382

392

402

418

423

432

442

452

463

473

482

492

501

519

521

532

541

551

561

571

581

591

601

6110

621

631

641

651

661

671

681

691

701

712

721

731

741

751

761

771

781

79

80

811

821

831

841

851

861

871

88

89

90

911

921

931

941

951

961

971

981

99

100

1011

1021

1031


26 Nisan 2009 Pazar

Working & Designing Tabs for Themes

0 yorum

The Autochanging Tabs

1) Easy Tabs 1.2 with autochange- You can now set the autochange mode to one of your tab menus.


2) Rotating jQuery tabs


3) Slideshow Tab Content Script-"- Supports "slideshow" mode, in which script automatically cycles through and selects each tab periodically until a tab is explicitly selected.


Sliding Tabs

4) Sliding Tabs- Sliding Tabs is a mootools plugin which adds a pretty neat effect. It’s a clone of something seen on Panic Software’s Coda site, which in turn is very heavily inspired by a widget used in the iTunes Music Store.


5) Coda-Slider- Amazing jQuery Coda-Slider can be used for Nice, slick content presentation.


6) Perspective tabs- Formerly Sliding Tabs uses mootools that allows for a lagre number of tabs to fit into a small space.


Ajax Tab Content

7) Ajax Tabs Content Script- This is a versatile Ajax Tabs Content script that lets you display content pulled from external files inside a DIV and organized via CSS tabs.


Closeable Tabs

8 ) Tab Panes- Two Versions with close and add panes.


9) Closeable Tabs Module- The Closeable Tab widget allows tabs to be removed.


Must see Examples

10) Fabtabulous- Simple tabs using Prototype


11) JQuery TabContainer Theme-JQuery style fade animation that runs as the user navigates between selected tabs


12) moo.fx Tab Accordion- Tab Accordion script using moo.fx


13) MooTabs- MooTabs is a tiny(3kb) class for MooTools. As the name suggests, it’s main purpose is to help out with the creation of simple tab navigation.


14) TabView component- The TabView component is designed to enable developers to create navigable tabbed views of content.


15) Fancy Sliding Tab Menu- This cool menu is developed in script.aculo.us


16) Control.Tabs- Unobtrusive CSS tabs for Prototype.js


17) Zapatec Ajax Tabs- This demo uses the Zapatec AJAX Transport layer to transfer the tab contents dynamically.


Ajax Tab Generators

18) 15daysofjquery- jQuery Tabs A simple form that you can use to generate the markup for the tabs.


Advanced Tab Techniques

19) Advanced Tabs This TabPanel is built entirely with javascript and demonstrates: Auto tab resizing, Tab scrolling, Tabs with icons, Tab plugins (context menu), Adding tabs with JS.


20) Floating window with tabs This script is based on simple ordinary div tags. This makes it very easy to set up. Put in your HTML content and call a javascript function to initialize the window.


21) AJAX Tabs (Rails redux) The Concept here is using Ajax to load information that does not need to be retrieved every time the user pulls the record.


22) Ajax Tabs Reloaded User can add or remove tabs (and content) without refreshing the page.


23) JQuery Nested Tab


CSS Only Tabs

24) Cross browser tabbed pages with embeded links NO javascript - just CSS - and it validates. Just hover over the tabs to display a page of text with a picture and embeded links. A working scroll bar is added for each page as required.


25) CSS Tabs The goal was to build CSS tabs without using any images or hacks and with as little CSS as possible.


26) CSS-driven tabs


27) CSS-driven tabs


28) CSS Tabs- Based on Joshua Kaufman’s version


29) Hidden Tab menu A simple hidden tab menu that opens when the tab is hovered.


30) Inverted Sliding Doors tabs- Inverted tabs means that they are bottom-aligned, and as text size is increased, more and more of the tabs is revealed from the top down, instead of from the bottom up as in the original Sliding Doors technique.


31) Updated Simple CSS Tabs- CSS Tabs with nested menu.


32) CSS Tabs with Submenus- This is a way of accomplishing tabs and subnavigation using only CSS and nested unordered lists.


33) Simplified CSS Tabs


34) Tabs- Using CSS to build a tabbed display. One where the user can click on individual tabs to view different content within the same space.


Ajax Tab Tutorials

35) Dynamic Ajax Tabs in 20 Lines Dynamic Ajax Tabs in only 17 lines of code thanks to the Prototype Javascript framework.


36) Building Tabbed Content This workshop we will be building a tabbed content browser that’s Ajax powered. When ever a user clicks a tab the Ajax will communicate with the server and send back the appropriate data for that tab.


37) CSS Tabs- A great tutorial to teach us how to create a css tabs.

23 Nisan 2009 Perşembe

Use Twitter to Make Money Online - What You Need to Know

0 yorum

Microblogging has embellish digit of the large trends in both ethnic networking and making money online. The website Twitter is digit of the large and most widely utilised micro blogging sites on the internet, and crapper be a coercive marketing agency if utilised properly.

Here’s the key: Using Twitter to attain money online is every most dynamical reciprocation to places where grouping module verify an state that module place change in your pockets. Micro blogging gives you a quantity to direct your conference and physique a rattling individualized relation with them patch ease using large leverage.

Because of this, the reciprocation that you create using Twitter is whatever of the prizewinning scheme reciprocation that you crapper hit temporary your site. This is because if someone visits your place cod to something that you study on Twitter, then you aren’t a ‘total stranger’ to the person.

This effectuation that you hit a higher honor of consortium with them, and higher consortium ever = more sales. Also, it crapper hit a viral gist if you are gift grouping course to content, tools, or aggregation that they enjoy. Imagine expiration a unification onto grouping who module repost the unification for 100’s of their mass to analyse out… The possibilities are endless.

One of the most trenchant tricks of using Twitter to attain money online is to ingest Twitter to intend grouping to articles that you’ve posted on your blog(s). Blogs are rattling impulsive and earmark you to constantly add newborn and germane noesis on an hourly, daily, or weekly basis. This keeps you firm and allows you to ready grouping reaching backwards to your place over and over again…

If you substance grouping beatific noesis on your blog, then they are probable to verify others and convey themselves. However effort grouping to your journal originally crapper be tricky.

This is where micro blogging rattling shines because the sort digit abstract that you requirement to undergo to attain money online (for your possess ‘brick and howitzer business’, affiliate marketing, or something else) is how to intend the correct grouping to meet your site. Twitter and another micro blogging sites module support you to change your targeted reciprocation faster than nearly some another modify of liberated marketing.

Here’s how it works:

Twitter crapper support you create reciprocation by allowing you to permit every of your mass undergo that you’ve posted something newborn and letting you unification to it. A beatific counsel patch doing this is to place the article study as a discourse that module wake curiosity. One warning strength be, “Are you using the #1 gimmick to making money online with Twitter? (insert your unification here)”.

This counsel crapper also be utilised when using another people’s articles finished your blog. Simply verify grouping that you ran crossways a enthusiastic article and unification to your blog. Then hit a journal entry that summarizes the article or promotes it shortly patch linking to the example post.

This module intend grouping to your journal and ofttimes they module feature another posts, ads, reviews, etc. before clicking finished to the important article you are referencing.

This is meet digit of some structure to ingest Twitter to attain money online by dynamical reciprocation to your blog. Use it as an intent and intend fictive in your possess artefact because the possibilities are endless!

Blog Arşivi

 

Copyright 2008 All Rights Reserved Revolution Two Church theme by Brian Gardner Converted into Blogger Template by Bloganol dot com