|
|
To add it to the "head" section of a web page insert it below the <head> tag thus:
First, if you use PHP you can include the meta-tag or send a response header.
Secondly, if you are able to change your web server configuration you can send a response header with all or some pages. See "How do I label using Apache?" or "How do I label using IIS?" for further information.
Thirdly, if you do not have access to your web server configuration you can still
modify your existing html pages. See "How do I label many web pages with a script?"
for some tips on changing many web pages all at once.
Here's one way to do it:
First, make a file inc.head.php:
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.
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:
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
opens the file represented by {} and reads it line by line. When the command finds <head> or <HEAD> it will replace it with
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:
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:
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:
In either case typically this is how you would add the module:
cd /path/to/apache/sources ./configure --enable-headers [other options] make su make install
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 file:
<IfModule mod_headers.c> Header set Rating "RTA-5042-1996-1400-1577-RTA" </IfModule>
Restart apache once you have added these lines to the httpd.conf file and check the changes:
HEAD http://mydomain.com/200 OK ... Rating: RTA-5042-1996-1400-1577-RTA
More information:
To create virtual hosts on apache add something similar to these apache configuration directives to the end of your apache httpd.conf configuration file:
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:
Also, please help by supporting ASACP and becoming a member to help fund the important work that ASACP does in continuing it's efforts to eliminate child pornography from the Internet. ASACP battles child pornography through its CP Reporting Hotline, and by organizing the efforts of the online adult industry to combat the heinous crime of child sexual abuse. To learn more about ASACP please visit: http://www.asacp.org
If you are a supporter of ASACP or would like to apply and have added the RTA label to your adult sites, you will be given a special button to show this honorable status in appreciation for your support.
Protect Your Business By Protecting Children!