Sunday, May 19, 2013

.htaccess Basic

What is .htaccess ? 

htaccess is a configuration file for use on web servers running the Apache Web Server software.

abbreviation from hypertext access

When a .htaccess file is placed in a directory  of apache then the .htaccess file is detected and executed by the Apache Web Server software on prioirty. 

.htaccess files can be used to alter the configuration of the Apache Web Server software to enable/disable additional functionality and features that the Apache Web Server software has to offer. These facilities include basic redirect functionality, for instance if a 404 file not found error occurs, or for more advanced functions such as content password protection or image hot link prevention.

'.htaccess' is the filename in full, it is not a file extension. For instance, you would not create a file called, 'file.htaccess', it is simply called, '.htaccess'. This file will take effect when placed in any directory which is then in turn loaded via the Apache Web Server software. The file will take effect over the entire directory it is placed in and all files and subdirectories within the specified directory.

This file is inaccessible through web.

You can create a .htaccess file using any good text editor such as TextPad, UltraEdit, Microsoft WordPad and similar (you cannot use Microsoft NotePad). 

.htaccess is mainly used to rewrite urls 

.htaccess example #1




   RewriteEngine on
   RewriteRule    ^$ app/webroot/    [L]
   RewriteRule    (.*) app/webroot/$1 [L]


it redirects every request to app/webroot


this file can be used to allow/deny access from specific ip



.htaccess example #2




order allow deny
deny from all
allow from 192.126.12.199


How to test it?

you can test ur .htaccess file here

http://htaccess.madewithlove.be/



Thursday, May 2, 2013

How TV Channels judge the number of viewers for a specific show?


Although different regions can use various methods, the traditional way to monitor television viewing habits has been a rating system. In many countries the Nielsen Company uses in-house devices that track the viewing habits of thousands of people. These numbers represent what average people of a certain age and gender watch, which then indicates the number of viewers who probably watch a particular show. Networks use this information to gauge how popular certain shows are, which determines how much they charge companies to advertise during those programs.
The Nielsen Company tracks what shows viewers watch on television networks through a representative sampling of about 25,000 households that let the company record what programs they watch.
Every time someone in a Nielsen household turns on a television, he or she indicates which person it is and the box tracks how long the person watches a show. Each member of a household has his or her viewing habits recorded individually, through indicating who is watching the television at any given time. If multiple people, including guests, view a program, each one enters information about his or her age and gender into the box so that the viewing habits of each person can be tracked. This viewer-specific data sets the information Nielsen records apart from data gathered by a regular cable television box.
The second way is tracking viewing habits of increased availability of shows on the Internet. Television networks can easily see how many people pay for and download a show through various websites, and many of them offer shows for free with limited advertising. The number of downloads can be recorded by television networks and might influence decisions about keeping certain programs airing. Many advertisers do not consider such viewing as valuable as regular TV watching, however, which has made Internet streams for shows less financially important than traditional broadcasting.