Apache, Lighttpd, nginx, Cherokee
twisterchen
Anbieter
Posts: 232 Joined: 2005-07-14 14:13
Post
by twisterchen » 2007-10-20 12:26
Hallo
Ich habe folgende Seite bei google schon gefunden
http://www.trafficklau.de/htaccess.html
Klappt auch alles bis auf wo mir aufgefallen ist immer nur dann wenn die htaccess Datei in dem jeweiligen ordner vorhandenist.
Meine Frage nun, ist es auch möglich eine htaccess Datei nur im docroot Verzeichniss zu plazieren und die gilt dann für sämmtliche unterordner.
Imo geht das nicht ich muss die Datei in jedem Ordner plazieren den ich Schützen will.
und so Sieht siehts imo aus.
Code: Select all
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www.)?domain.de(/.*)?$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www.)?domain.com(/.*)?$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www.)?domain.com(/.*)?$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www.)?domain.de(/.*)?$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(daten.)?domain.de(/.*)?$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(forum.)?domain.de(/.*)?$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(forum.)?domain.de(/.*)?$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www.)?domain.com(/.*)?$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www.)?domain-germany.com(/.*)?$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www.)?domain-germany.de(/.*)?$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www.)?domain-germany.net(/.*)?$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www.)?domain-shop.com(/.*)?$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www.)?domain-team.com(/.*)?$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www.)?domain-team.de(/.*)?$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www.)?domain-team.net(/.*)?$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www.)?domain.info(/.*)?$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www.)?domain.net(/.*)?$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www.)?domain-service.de(/.*)?$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(technik.)?domain-service.de(/.*)?$ [NC]
RewriteRule .(gif|jpg|GIF|JPG|png|PNG|wmv|WMV|mp3|MP3|mpg|MPG|mpeg|MPEG|wma|WMA)$ http://domain.de/spacer.gif [R,L]
Vielen Dank
Gruss
Twisterchen
oxygen
Posts: 2138 Joined: 2002-12-15 00:10
Location: Bergheim
Post
by oxygen » 2007-10-20 12:29
Das ist Dumm. So erzeugst du mehr Kollateralschaden als du davon Nutzen hast.
twisterchen
Anbieter
Posts: 232 Joined: 2005-07-14 14:13
Post
by twisterchen » 2007-10-20 12:37
Warum ? du weist ja nicht wie die Seitenstruktur aufgebaut ist vielleicht könntest du das ja mal belegen warum das dumm sein könnte
Gruss
Twisterchen
Joe User
Project Manager
Posts: 11191 Joined: 2003-02-27 01:00
Location: Hamburg
Contact:
Post
by Joe User » 2007-10-20 13:12
Code: Select all
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(daten.|forum.|www.)?domain.(de|com|net|info)/ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www.)?domain-germany.(de|com|net)/ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www.)?domain-team.(de|com|net)/ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www.)?domain-shop.com/ [NC]
RewriteCond %{HTTP_REFERER} !^http://(technik.|www.)?domain-service.de/ [NC]
RewriteRule .(gif|jpg|GIF|JPG|png|PNG|wmv|WMV|mp3|MP3|mpg|MPG|mpeg|MPEG|wma|WMA)$ http://domain.de/spacer.gif [R,L]
Liegen in der Unterverzeichnissen weitere .htaccess? Schon im VHost-Container der httpd.conf (ohne .htaccess) definiert?
twisterchen
Anbieter
Posts: 232 Joined: 2005-07-14 14:13
Post
by twisterchen » 2007-10-20 14:41
Joe User wrote:
Liegen in der Unterverzeichnissen weitere .htaccess?
Nein liegen noch keine
Joe User wrote:
Schon im VHost-Container der httpd.conf (ohne .htaccess) definiert?
Nein daran hab ich noch gar nicht gedacht, kann ich das einfach so eintragen oder muss ich ein Dir angeben
z.B.
Code: Select all
<VirtualHost xxxxxxxxxx:80>
ServerName xxxxxxxx.de:80
ServerAlias www.xxxxxxxx.de
UseCanonicalName Off
ServerAlias xxxx.de
ServerAlias xxxx.de
ServerAlias xxxx-team.de
ServerAlias wxxxxxxx-team.de
ServerAlias www.xxxxxx.com
ServerAdmin "xxxxxx@xxxxx.de"
DocumentRoot /home/httpd/vhosts/xxxxx.de/httpdocs
CustomLog /home/httpd/vhosts/xxxxx.de/statistics/logs/access_log plesklog
ErrorLog /home/httpd/vhosts/xxxx.de/statistics/logs/error_log
<IfModule mod_userdir.c>
UserDir /home/httpd/vhosts/xxxxx.de/web_users
</IfModule>
<IfModule mod_ssl.c>
SSLEngine off
</IfModule>
<Directory /home/httpd/vhosts/xxxxx.de/httpdocs>
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(daten.|forum.|www.)?domain.(de|com|net|info)/ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www.)?domain-germany.(de|com|net)/ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www.)?domain-team.(de|com|net)/ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www.)?domain-shop.com/ [NC]
RewriteCond %{HTTP_REFERER} !^http://(technik.|www.)?domain-service.de/ [NC]
RewriteRule .(gif|jpg|GIF|JPG|png|PNG|wmv|WMV|mp3|MP3|mpg|MPG|mpeg|MPEG|wma|WMA)$ http://domain.de/spacer.gif [R,L]
<IfModule sapi_apache2.c>
php_admin_flag engine off
</IfModule>
<IfModule mod_php5.c>
php_admin_flag engine off
</IfModule>
Options -Includes -ExecCGI
</Directory>
Include /home/httpd/vhosts/xxxxxxx.de/conf/vhost.conf
oder hier
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(daten.|forum.|www.)?domain.(de|com|net|info)/ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www.)?domain-germany.(de|com|net)/ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www.)?domain-team.(de|com|net)/ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www.)?domain-shop.com/ [NC]
RewriteCond %{HTTP_REFERER} !^http://(technik.|www.)?domain-service.de/ [NC]
RewriteRule .(gif|jpg|GIF|JPG|png|PNG|wmv|WMV|mp3|MP3|mpg|MPG|mpeg|MPEG|wma|WMA)$ http://domain.de/spacer.gif [R,L]
</VirtualHost>
Vielen Dank
Twisterchen[
oxygen
Posts: 2138 Joined: 2002-12-15 00:10
Location: Bergheim
Post
by oxygen » 2007-10-20 15:42
Twisterchen wrote: Warum ? du weist ja nicht wie die Seitenstruktur aufgebaut ist vielleicht könntest du das ja mal belegen warum das dumm sein könnte
Mit der Seitenstruktur hat das nichts zu tun, dass du Nutzer aussperrst die ihren Browser so eingestellt haben, das kein Referer übertragen wird. Gleiches gilt für Download-Manager, Feed-Reader etc.
guwapo
Posts: 42 Joined: 2007-01-21 15:07
Post
by guwapo » 2007-10-20 20:36
oxygen wrote: Mit der Seitenstruktur hat das nichts zu tun, dass du Nutzer aussperrst die ihren Browser so eingestellt haben, das kein Referer übertragen wird. Gleiches gilt für Download-Manager, Feed-Reader etc.
Das ist ein
RewriteCond ition (= Bedingung), d.h. obiges wird nur ausgeführt, wenn der Referer _nicht_ leer ist.
Somit werden alle leeren Refs erlaubt. Ich sehe von daher keinen groben Fehler.
Joe User
Project Manager
Posts: 11191 Joined: 2003-02-27 01:00
Location: Hamburg
Contact:
Post
by Joe User » 2007-10-20 21:39
So sollte es aussehen:
Code: Select all
<VirtualHost *:80>
ServerName www.domain.tld
ServerAdmin webmaster@domain.tld
DocumentRoot "/var/www/domain.tld/htdocs"
<Directory "/var/www/domain.tld/htdocs">
Options -All +FollowSymLinks +ExecCGI
AllowOverride Options FileInfo AuthConfig Limit
Order allow,deny
Allow from all
</Directory>
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(daten.|forum.|www.)?domain.(de|com|net|info)/ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www.)?domain-(germany|team|shop).(de|com|net)/ [NC]
RewriteCond %{HTTP_REFERER} !^http://(technik.|www.)?domain-service.de/ [NC]
RewriteRule .(gif|jpg|png|wmv|mp3|mpg|mpeg|wma)$ http://domain.de/spacer.gif [R,L]
</VirtualHost>
twisterchen
Anbieter
Posts: 232 Joined: 2005-07-14 14:13
Post
by twisterchen » 2007-10-21 17:00
Vielen Dank
ich werde das mal testen hatt nur sehr viel zu tun übers wochenende sollte ich mit euren tips nicht weiter kommen melde ich mich bestimmt nochmal
Vielen Dank
Twister