Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Jun 2001
Posts: 729
Coder
Coder
Offline
Joined: Jun 2001
Posts: 729
Just noticed a ton of places linking off my images mad Did a search a wanted to implement LKs method but it does not seem to be working properly...

login.cgi - located in cgi-bin folder anc chmoded to 755
Code
#!/usr/bin/perl
my $qs = $ENV{QUERY_STRING};
$qs =~ s/^file=/noncgi///isg;
open(FILE, ">>/usr/local/hostboard/mainboard/htdocs/logg.cgi");
print FILE "$ENV{'REMOTE_ADDR'} - $qs - $ENV{HTTP_REFERER}";
close(FILE);
chmod(0777, "/usr/local/hostboard/mainboard/htdocs/logg.cgi");
if ($qs =~ /(.gif|.jpg)$/) {
print "Location: http://www.hostboard.com/stolen.gif";
} else {
print "Content-type: text/html";
print qq~<html>....~;}
.htaccess in a folder with images I am looking to block.

Code
RewriteEngine On
Options +FollowSymlinks
## LK
#RewriteBase /
## Rewrite Rule for images
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !hostboard.com [NC]
RewriteRule ^(.*)$ http://www.hostboard.com/cgi-bin/loggin.cgi?file=%{REQUEST_URI} [R,L]
DirectoryIndex /
Will this also block directories underneath the one I am also trying to protect or do I have to copy .htaccess into each folder?

Sponsored Links
Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
.htaccess should be read by any directory UNDER the one that the file is located in...

IE:
I have .htaccess in /var/www/html (or www.gizzy.com/); any directories under /var/www/html (or www.gizzy.com/) read the rules of the .htaccess file.

Myself, I just manage my own .htaccess as:
Code
# Turn Rewrite Engine On #
RewriteEngine on

# Start Allowed Hosts #
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !virtualnightclub.net [NC]
RewriteCond %{HTTP_REFERER} !69.9.166.202 [NC]
RewriteCond %{HTTP_REFERER} !ubbdev.com [NC]
RewriteCond %{HTTP_REFERER} !ubbcentral.com [NC]
RewriteCond %{HTTP_REFERER} !infopop.com [NC]
RewriteCond %{HTTP_REFERER} !ubbdev.com [NC]
# End Allowed Hosts #

# Start defined files & redirect location #
RewriteRule .*.(jpg|jpeg|bmp|gif|png|psd)$ http://errors.virtualnightclub.net/dnl.gif [R,NC]
# End defined files & redirect location #
replace the error image with any you want, if you don't want one then just replace it with a "-".


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
preferrably an image 3000x3000 wink


- Allen wavey
- What Drives You?
Joined: Jun 2001
Posts: 729
Coder
Coder
Offline
Joined: Jun 2001
Posts: 729
The only thing I really liked about LKs was the ability to log who was linking to you. Anyway to figure out why it is not working? Maybe I did something wrong?

Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
:shrug: ask LK? hehe...


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Sponsored Links
Joined: Mar 2001
Posts: 7,394
LK Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
Joined: Mar 2001
Posts: 7,394
Could it be because your file is called login.cgi but you're linking to loggin.cgi? confused

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
hehe, I'd check that first laugh


- Allen wavey
- What Drives You?

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
JAISP
JAISP
PA
Posts: 449
Joined: February 2008
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)