TGP Tutorials & Articles

Error Traffic, Redirects, and .htaccess

by Andrew of AdultWebmaster101.net

Once you've got dozens (if not hundreds) of galleries, free sites and pages drawing traffic from every corner of the adult internet, it's inevitable that some of those visitors will get directed to an error page. Perhaps a page is missing or a link is incorrect, and the surfer gets a 404 Not Found page. Or else a surfer starts snooping around your directories looking for more free porn, and end up on a 403 Forbidden page. (You do have indexes off on your directories, right? If not, read on!)

All of this error traffic can add up to several hundreds or thousands of hits a day. This is valuable traffic that you can use to make extra money! One common use for error traffic is to redirect it to your hub (generally a TGP or link list hosted at the root of your domain) or to a special page with sponsor links. If you can send at least 500 visitors a day, Review Cash will set up a pay site review directory for you to redirect your error and exit traffic to!

You can also sell your 404 traffic to a traffic broker such as Buy404s. They pay around $4.00 per thousand hits. This can easily generate the equivalent of several extra sales a month!

To redirect your error traffic, you need to edit the .htaccess file that lies in every directory. If you want to set options for your entire site, edit the .htaccess file in your domain's root directory. Any settings you make to the .htaccess file in a subdirectories will override the settings in your root directory.

Open up your .htaccess file in a text editor such as Notepad. If there is no .htaccess file for the directory, simply create or upload one. To redirect your 404 traffic, add this line to .htaccess:

	ErrorDocument 404 http://www.domain.com/page.html

To produce 403 traffic, you need to turn indexes off on all directories that do not have an index page. Add this line to your .htaccess file:

	Options All -Indexes

Then, to redirect your 403 traffic, add this line:

	ErrorDocument 403 http://www.domain.com/page.html

Another useful thing you can do with .htaccess is redirecting visitors from an old, non-existent page to the current page. This can be accomplished using the following syntax:

	Redirect oldpage.html http://www.domain.com/newpage.html

The first argument is the relative path of the old page on the server (in this case, oldpage.html). The second argument is the absolute URL to the new page.

Be sure to turn off hotlinking for all your domains, otherwise you could waste bandwidth from unscrupulous webmasters linking directly to your images and movies. This can easily be done in cPanel, under Hotlink Protection. Otherwise, you can use this syntax to turn off hotlinking.

	RewriteEngine on
	RewriteCond %{HTTP_REFERER} !^$
	RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain.com/.*$ [NC]
	RewriteRule .*\.(jpg|jpeg|gif|png|bmp|mpg|wmv|mpeg)$ - [F,NC]

Replace domain.com in line 3 above with the domain of your website. Repeat for every domain you want to allow to hotlink to the files on this site.

There's more you can do with .htaccess, but these are the most important features you'll need to know. Check out this .htaccess reference, or the Apache documentation for more information.

Copyright 2004-2008 TGP Factory. All Rights Reserved.