Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    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:

    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\.)?*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?*$ [NC]
    RewriteRule .*\.(gif|jpg|jpeg|bmp|png|mp3|wmv|avi)$ [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:

    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!

  2. #2
    Edit: I'm only blocking this site right now, 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\.)?*$ [NC]
    RewriteRule .*\.(gif|jpg|jpeg|bmp|mp3|avi|wmv|png)$ [R,NC]

    or the three alternate configurations:

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

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

    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?*$ [NC]
    RewriteRule .*\.(gif|jpg|jpeg|bmp|mp3|avi|wmv|png)$ [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

  3. #3

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts