Blokowanie dostępu
Aby zablokować np. upierdliwego internautę albo uciążliwą wyszukiwarkę/bota wystarczy wprowadzić w pliku .htaccess następujący wpis:
Deny from XXX.XXX.XXX.XXX
gdzie zamiast ciągu XXX.XXX.XXX.XXX należy wpisać adres IP, który chcemy zablokować.
Też mam z nim problem. Tyle, że w JoomlaStats nie potrafię sprawdzić jego IP. Można wpisać
Deny from http://www.cuil.com/twiceler/robot.html Czy musi być IP?
zwiastun
15-11-2009, 12:34
można
fotopole
15-11-2009, 12:48
Mój htaccess wygląda tak
RewriteEngine On
########## Begin - Rewrite rules to block out some common exploits
## If you experience problems on your site block out the operations listed below
## This attempts to block the most common type of exploit `attempts` to Joomla!
#
# Block out any script trying to set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a ********** tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
#
########## End - Rewrite rules to block out some common exploits
# Uncomment following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (just / for root)
# RewriteBase /
########## Begin - Joomla! core SEF Section
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ [NC]
RewriteRule (.*) index.php
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#
########## End - Joomla! core SEF Section
w którym miejscu i i jak to wpisać??
zwiastun
15-11-2009, 12:57
Na www.pomoc.joomla (i nie tylko) jet materiał o .htaccess. PeFik juz odpisywał. Może trochę samodzielności?
fotopole
15-11-2009, 13:31
ok, poczytałem
W katalogu głównym mam dwa htaccess jeden z rozszerzeniem txt, drugi bez rozszerzenia, ale daje tez się otworzyć notatnikiem. Edytowałem ten z txt.
Wprowadziłem wpisdeny from all
allow from 38.99.13.124 - to jest ten Twiceler-0.9 http://www.cuil.com/twiceler/robot.html)
tylko pytanie w którym miejscu dałem to na samym końcu, zaraz po
########## End - Joomla! core SEF Section
Czy teraz będzie blokować mi tego bota?
zwiastun
15-11-2009, 13:35
chyba jednak nie doczytałeś z należną uwagą. Ten z rozszerzeniem .txt to htaccess.txt, do wykorzystania, żeby samemu nie tworzyć od podstaw. ale jak wskazuje nazwa jest to plik htaccess.txt a nie .htaccess
fotopole
15-11-2009, 13:47
ok, czyli mam edytować ten bez txt? Wygląda tak:
DirectoryIndex index.php
RewriteEngine On
RewriteBase /
########## Begin - Rewrite rules to block out some common exploits
## If you experience problems on your site block out the operations listed below
## This attempts to block the most common type of exploit `attempts` to Joomla!
#
# Block out any script trying to set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a ********** tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
#
########## End - Rewrite rules to block out some common exploits
w którym miejscu mam wpisać
deny from all
allow from 38.99.13.124 ??
zwiastun
15-11-2009, 13:53
Czy to naprawdę takie trudne?
Czy to naprawdę trzeba pokazywać paluszkiem?
http://www.pomoc.joomla.pl/content/view/441/51/
fotopole
15-11-2009, 13:59
Po prostu nie chcę czegoś zepsuć, aby mi strona potem nie chodziła.
zwiastun
15-11-2009, 14:07
Strach ma wielkie oczy!
W artykule, do którego dałem odnośnik (w innych także),
* jest informacja, że znak # to znak komentarza, a więc, że wiersze rozpoczynające się od tego znaku nie są interpretowane
* jest przetłumaczony fragment pliku .htaccess, z którego łatwo się domyślec, że po komentarzu następują czasem nieskomentowane wiersze ustawień
* jest też uwaga, że wpisanie nieprawidłowych ustawień spowoduje błąd
Wpiszesz źle, to poprawisz - cała filozofia!
fotopole
15-11-2009, 14:50
teraz mój plik wygląda tak:
DirectoryIndex index.php
RewriteEngine On
RewriteBase /
########## Begin - Rewrite rules to block out some common exploits
## If you experience problems on your site block out the operations listed below
## This attempts to block the most common type of exploit `attempts` to Joomla!
#
# Block out any script trying to set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a ********** tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
Order Allow,Deny
Allow from all
Deny from 38.99.13.124
Deny from 38.99.44.102
Deny from 38.99.44.103
Deny from 38.99.44.105
Deny from 64.1.215.164
Deny from 67.218.116.162
Deny from 67.218.116.164
Deny from 78.46.51.83
Deny from 173.29.75.122
Deny from 208.36.144.8
Deny from 216.129.119.10
Deny from 216.129.119.11
Deny from 216.129.119.40
Deny from 216.129.119.41
Deny from 216.129.119.42
Deny from 216.129.119.43
Deny from 216.129.119.44
#
########## End - Rewrite rules to block out some common exploits
Czy w tej chwili będą blokowanie te wszystkie IP? To są IP tego bota Twiceler-0.9 http://www.cuil.com/twiceler/robot.html
A może lepiej wpisać
Order Allow,Deny
Allow from all
Deny from http://www.cuil.com/twiceler/robot.html , bo widzę, że i tak mnie ten bot odwiedza - sukcesywnie co ok.9 minut.
??