Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Write an article for LinuxForums Today! Win Great Prizes!
Find the answer to your Linux question:
New to Linux Forums? Register here for free!
    Linux Forums > GNU Linux Zone > Servers > htaccess problems

Forgot Password?
 Servers   Anything server related, Apache, MySQL, Samba, server security, sendmail, exim, etc

Site Navigation
Linux Articles
Linux Forums
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds
Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Reply
 
Thread Tools Display Modes
Old 07-05-2004   #1 (permalink)
Just Joined!
 
Join Date: Jul 2004
Posts: 3
htaccess problems

Hi, I think I should mention that I'm new to this forums and that I'm not at all familiar with most server issues. I also just read the sticky about linking to this place so I'm sure to link to this place on my update log if the people here can help me out

Truth is that I've fallen victim to a hotlinking problem on some of my sites hosted by 50free. My bandwith these past four days already exceeded the amount used during the entire past month while visitor numbers have not greatly increased. So while quickly trying to find a solution to this problem I stumbled upon the following htaccess code generator:

http://www.htmlbasix.com/disablehotlinking.shtml

Initially I filled in the following fields:
the three urls of my subdomains at 50free,
the replacement image hosted on another site,
several file types to block (added png wav mp3 and some others just in case),
and I selected a different code generator each time, creating the following:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?linkabuse.50free.org(/)?.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?kinoko.50free.org(/)?.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?ritsuka.50free.org(/)?.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?sora.50free.org(/)?.*$ [NC]
RewriteRule .*\.(gif|jpg|jpeg|bmp|png|mp3|wmv|avi)$ http://members.lycos.nl/lampapalla/deviltchi_eating.gif [R,NC]
(I pressed enter after the last line as it instructed)

I pasted it into the .htaccess file that I created on my server in the root directory for all domains. But all of my sites threw in the standard CGI error when visited which is still visible here: http://kinoko.50free.org/kinoko.htm

things I tried were setting the chmod values of the htaccess to 777 to check if it was a restriction problem but it came out negative. Using the same values I tried altering the input of the generator to affect only one subdomain and placed the output .htaccess file into the matching subdirectory. But even for one domain this code still threw the same errors (on that subdomain). Since I basically don't know anything of writing the code itself I wondered if that could be causing the problem, and since I found out that it was a linux server related feature I ended up here

Here are the server details:

Operating system : Debian GNU/Linux
Perl Modules : Click to View *
Perl version : v5.8.0
Perl path : /usr/bin/perl
Sendmail path : /usr/sbin/sendmail
MySQL version : 4.0.15
PHP version : 4.3.3
PHP Info : Click to View **

** PHP info just in case:

PHP Version 4.3.3

System Linux verdi4 2.4.26-ipacct #1 SMP Fri Apr 16 12:25:35 EEST 2004 i686
Build Date Oct 20 2003 19:31:23
Configure Command '../configure' '--prefix=/usr' '--with-apxs=/usr/bin/apxs' '--with-regex=php' '--with-config-file-path=/etc/php4/apache' '--disable-rpath' '--enable-memory-limit' '--disable-debug' '--with-layout=GNU' '--with-pear=/usr/share/php' '--enable-calendar' '--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-trans-sid' '--enable-bcmath' '--with-bz2' '--enable-ctype' '--with-db4' '--with-iconv' '--enable-exif' '--enable-filepro' '--enable-ftp' '--with-gettext' '--enable-mbstring' '--with-pcre-regex=/usr' '--enable-shmop' '--enable-sockets' '--enable-wddx' '--disable-xml' '--with-expat-dir=/usr' '--enable-yp' '--with-zlib' '--without-pgsql' '--with-kerberos=/usr' '--with-openssl=/usr' '--with-exec-dir=/usr/lib/php4/libexec' '--disable-static' '--with-curl=shared,/usr' '--with-dom=shared,/usr' '--with-dom-xslt=shared,/usr' '--with-dom-exslt=shared,/usr' '--with-zlib-dir=/usr' '--with-gd=shared,/usr' '--with-jpeg-dir=shared,/usr' '--with-xpm-dir=shared,/usr/X11R6' '--with-png-dir=shared,/usr' '--with-freetype-dir=shared,/usr' '--with-imap=shared,/usr' '--with-imap-ssl' '--with-ldap=shared,/usr' '--with-mcal=shared,/usr' '--with-mhash=shared,/usr' '--with-mm' '--with-mysql=shared,/usr' '--with-unixODBC=shared,/usr' '--with-recode=shared,/usr' '--enable-xslt=shared' '--with-xslt-sablot=shared,/usr' '--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-sybase-ct=shared,/usr' '--with-ttf=shared,/usr' '--with-t1lib=shared,/usr'
Server API Apache
Virtual Directory Support disabled
Configuration File (php.ini) Path /etc/php4/apache/php.ini
PHP API 20020918
PHP Extension 20020429
Zend Extension 20021010
Debug Build no
Thread Safety disabled
Registered PHP Streams php, http, ftp, compress.bzip2, compress.zlib

*the link to perl modules doesn't work

Hope I've got the right forum this time
Anyway thanks!
Devilgotchi is offline  



Reply With Quote
Old 07-06-2004   #2 (permalink)
Just Joined!
 
Join Date: Jul 2004
Posts: 3
Edit: I'm only blocking this site right now http://linkabuse.50free.org, so check here for the error

I placed the following .htaccess file into the subdirectory for my site:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?linkabuse.50free.org(/)?.*$ [NC]
RewriteRule .*\.(gif|jpg|jpeg|bmp|mp3|avi|wmv|png)$ http://members.lycos.nl/lampapalla/deviltchi_eating.gif [R,NC]

or the three alternate configurations:

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?linkabuse.50free.org(/)?.*$ [NC]
RewriteRule .*\.(gif|jpg|jpeg|bmp|mp3|avi|wmv|png)$ http://members.lycos.nl/lampapalla/deviltchi_eating.gif [R,NC]


Options +FollowSymlinks
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?linkabuse.50free.org(/)?.*$ [NC]
RewriteRule .*\.(gif|jpg|jpeg|bmp|mp3|avi|wmv|png)$ http://members.lycos.nl/lampapalla/deviltchi_eating.gif [R,NC]

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?linkabuse.50free.org(/)?.*$ [NC]
RewriteRule .*\.(gif|jpg|jpeg|bmp|mp3|avi|wmv|png)$ http://members.lycos.nl/lampapalla/deviltchi_eating.gif [R,NC]

--

again I set restrictions to 777
so can anyone help me with this error please T_T I already tried to mail my host but seems like they died a long time ago
Devilgotchi is offline   Reply With Quote
Old 07-13-2004   #3 (permalink)
Just Joined!
 
Join Date: Jul 2004
Posts: 3
Anyone?
Devilgotchi is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Free Magazines
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
Learn about everything you'll need to build and maintain your Linux servers, and to deploy Web applications to them.
subscribe
Open Source Security Myths Dispelled
Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization
subscribe
InformationWeek
InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology.
subscribe



All times are GMT. The time now is 03:51 PM.






© 2000 - - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.3.1