.
To add it to the "head" section of a web page insert it below the <head> tag thus:
is available by default from most ISPs and it can make labelling with RTA much
easier. If you are in the process of designing a site having a simple file with the
"head" section of the page to
in
your other pages is probably the easiest way to go. (The "head" is the part of your web
page between <head> and </head> that usually contains the title,
search keywords and other information that isn't part of the main body of the document.)
Next, in your other files such as index.php you can add the following at the top of the page
to replace the existing <head> section:
Although this is probably the easiest way to inject the RTA label into your php pages,
it is also possible to add the RTA label to the response headers with the
header function.
Use it like this:
Note that you can get an error from php if the document has already started outputing.
There are ways around this.
If you have too many php pages with their own head sections to replace with a manually
added include statement you can still do site-wide labelling or use
scripts to edit large numbers of pages at once.
The examples that follow use the perl programming language but they can be adapted to use
other languages.
There are a number of ways to identify files that need to be changed but changing them is
pretty much always the same process. On unix based systems (linux, bsd, solaris etc) the
native "find" command can be used:
Lets break this command down to see what it is doing. First we have:
find -type f -name '*.html'
This will find every file with a file name that ends in .html. Next we have the -exec.
The command after -exec will be run on every file found. The file name is represented by
{} in the -exec command. The command
perl -pi.backup -e \
's#<head>#<head>\n<meta name="RATING" content="RTA-5042-1996-1400-1577-RTA" />#i' {}
opens the file represented by {} and reads it line by line. When the command finds <head> or <HEAD>
it will replace it with
<head>
<meta name="RATING" content="RTA-5042-1996-1400-1577-RTA" />
Before actually changing the file perl will make a backup copy of the file with the extension .backup.
If you want to remove these backup files try this command:
Find is a very powerful command and may locate more files than you would want to change. To
find all the files in a given directory copy the following to a file:
If you saved this file to /home/me/rta.pl you can run it thus:
cd /directory/i/want/to/change
perl /home/me/rta.pl
If you are on a windows based system and you want to change files in subdirectories
you will want to use perl's native version of find:
Similarly if you saved this to the file rta.pl somewhere on your command path
you could invoke it thus by opening a command window and typing:
perl -S rta.pl
The -S option forces perl to search on your command path for the script.
Note that cd is not used in this case as you have your starting directory
already written in. To make a version where you have to cd to the directory
replace 'c:\\directory\to\start\in' with '.'. To find a windows version of perl
look here.
Caveat: be very careful about running any automatic editing commands multiple
times as they may have unexpected effects. In this case, having more than one
rta label isn't likely to be a problem. However, to be careful and especially if
you are working with large numbers of files, make a backup of the original files
before you start.
While we have tested all of the examples in this section, RTAlabel.org does not
warrant that these code examples will be suitable for your use. Please
carefully test your scripts on small numbers of files to make sure they work
before proceeding.
More information:
find command
Perl
File::Find
or rebuild apache with the module added in.
It may be the case that mod_headers is part of your build however. To check you'll want to first
look for
in your httpd.conf file. If the module is compiled into apache itself you can see if "mod_headers.c" shows up in
Once you have established that mod_headers is available on your system add the following to your httpd.conf or .htaccess file:
Restart apache once you have added these lines to the httpd.conf file and check the changes:
. This
.
To create virtual hosts on apache add something similar to
these apache configuration directives to the end of your
apache httpd.conf
configuration file:
When your browser gets content from a web server it gets more than just the web page.
The content that precedes the download of the web page gives the browser useful information
about that content. Inserting the RTA label into the response headers is a very powerful way
to keep kids away from adult content.
Generally the response header for any requested content would start with a response
code - the "200 OK" in the example below. This tells the browser whether or not the
server could provide the content. Following that there are various pieces of information
called "metadata" relating to the request. These follow the format of:
Header: metadata
Here is an example of a full response header with the rta label included.
200 OK
Connection: close
Date: Wed, 13 Feb 2008 22:36:40 GMT
Accept-Ranges: bytes
ETag: "800b7-65-503db400"
Server: Apache/2.0.59 (Unix) ...
Content-Length: 101
Content-Type: text/html
Last-Modified: Mon, 16 Jul 2007 19:17:36 GMT
Client-Date: Wed, 13 Feb 2008 22:36:33 GMT
Client-Peer: 24.86.194.107:80
Client-Response-Num: 1
Rating: RTA-5042-1996-1400-1577-RTA
... actual content would follow here ...
The end of the response headers is indicated by a blank line.
The actual content being requested would then follow along after this information.
The content could be as simple as a basic html file or as complex as an mpeg or
quicktime movie.
You can add response headers on the fly using PHP, apache and IIS.
If you want to look at the response headers for a specific web request and you are
on a unix based system you can try the "HEAD" command. Invoke this command this way:
HEAD https://my-url.com