{"id":3667,"date":"2022-04-07T14:41:07","date_gmt":"2022-04-07T11:41:07","guid":{"rendered":"https:\/\/www.domainhizmetleri.com\/blog\/?p=3667"},"modified":"2024-04-08T08:53:36","modified_gmt":"2024-04-08T05:53:36","slug":"htaccess-ve-geoip-ile-ulke-erisim-engelleme","status":"publish","type":"post","link":"https:\/\/www.domainhizmetleri.com\/blog\/htaccess-ve-geoip-ile-ulke-erisim-engelleme\/","title":{"rendered":".htaccess ve GeoIP ile \u00dclke Eri\u015fim Engelleme"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Yaz\u0131 \u0130\u00e7eri\u011fi<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"\u0130\u00e7indekiler Tablosunu A\u00e7\/Kapat\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #0a0a0a;color:#0a0a0a\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #0a0a0a;color:#0a0a0a\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.domainhizmetleri.com\/blog\/htaccess-ve-geoip-ile-ulke-erisim-engelleme\/#Domainhizmetleri_Web_Hostinglerinde_Turkiye_Disina_Erisimi_Engelleme\" >Domainhizmetleri Web Hosting&#8217;lerinde T\u00fcrkiye D\u0131\u015f\u0131na Eri\u015fimi Engelleme<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.domainhizmetleri.com\/blog\/htaccess-ve-geoip-ile-ulke-erisim-engelleme\/#Turkiye_Disina_Erisim_Engelle_Fakat_Google_ASNye_Izin_Ver\" >T\u00fcrkiye D\u0131\u015f\u0131na Eri\u015fim Engelle Fakat Google ASN&#8217;ye \u0130zin Ver<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.domainhizmetleri.com\/blog\/htaccess-ve-geoip-ile-ulke-erisim-engelleme\/#Belirli_Bir_Ulkeye_Erisimi_Engelleme\" >Belirli Bir \u00dclkeye Eri\u015fimi Engelleme<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.domainhizmetleri.com\/blog\/htaccess-ve-geoip-ile-ulke-erisim-engelleme\/#Ornek_1_%E2%80%93_OVH_ISPsinden_Erisimleri_Engelleme\" >\u00d6rnek 1 &#8211; OVH ISP&#8217;sinden Eri\u015fimleri Engelleme<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.domainhizmetleri.com\/blog\/htaccess-ve-geoip-ile-ulke-erisim-engelleme\/#Ornek_2_%E2%80%93_Hetzner_ISPsinden_Erisimleri_Engelleme\" >\u00d6rnek 2 &#8211; Hetzner ISP&#8217;sinden Eri\u015fimleri Engelleme<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.domainhizmetleri.com\/blog\/htaccess-ve-geoip-ile-ulke-erisim-engelleme\/#Ornek_3_%E2%80%93_Her_Iki_ISPden_Erisimi_Engelleme\" >\u00d6rnek 3 &#8211; Her \u0130ki ISP&#8217;den Eri\u015fimi Engelleme<\/a><\/li><\/ul><\/nav><\/div>\n<div class=\"wpb-content-wrapper\">[vc_row][vc_column][vc_message message_box_style=&#8221;3d&#8221; message_box_color=&#8221;danger&#8221; icon_fontawesome=&#8221;fas fa-exclamation-triangle&#8221;]<span style=\"color: #000000;\"><b>Bu yaz\u0131da payla\u015ft\u0131\u011f\u0131m\u0131z kodlar yaln\u0131zca Domainhizmetleri <\/b><\/span><span style=\"color: #ff0000;\"><b><a style=\"color: #ff0000;\" href=\"https:\/\/www.domainhizmetleri.com\/limitsiz-hosting\/\" target=\"_blank\" rel=\"noopener\">hosting sunucular\u0131nda<\/a><\/b><\/span><span style=\"color: #000000;\"><b> test edilmi\u015ftir.<br \/><\/b>Farkl\u0131 firma ve sunucularda konfig\u00fcrasyon uyu\u015fmazl\u0131\u011f\u0131 kaynakl\u0131 \u00e7al\u0131\u015fmayabilir. Alternatif \u00e7\u00f6z\u00fcm olarak <span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"https:\/\/www.domainhizmetleri.com\/blog\/php-ile-ulke-koduna-gore-ziyaretci-ip-adresi-engelleme\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">PHP ile \u00dclke Koduna G\u00f6re Ziyaret\u00e7i IP Adresi Engelleme<\/a><\/span>\u00a0makalemizi uygulayabilirsiniz.<\/span> [\/vc_message][\/vc_column][\/vc_row]\n\n\n\n<p>\u0130nternet sitenize gelen siber sald\u0131r\u0131lara kar\u015f\u0131 g\u00fcvenlik sa\u011flamak veya ki\u015fisel tercihlerinizden dolay\u0131 di\u011fer \u00fclkelerden internet sitenize eri\u015filmesini engellemek istiyor olabilirsiniz.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Domainhizmetleri_Web_Hostinglerinde_Turkiye_Disina_Erisimi_Engelleme\"><\/span>Domainhizmetleri Web Hosting&#8217;lerinde T\u00fcrkiye D\u0131\u015f\u0131na Eri\u015fimi Engelleme<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>A\u015fa\u011f\u0131da iletmi\u015f oldu\u011fumuz kodlar\u0131, projenizin k\u00f6k dizini (public_html) i\u00e7indeki <strong>.htaccess<\/strong> dosyan\u0131z i\u00e7erisine ekleyerek T\u00fcrkiye d\u0131\u015f\u0131ndaki t\u00fcm \u00fclkelerden internet sitenize eri\u015fimi engelleyebilirsiniz.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">&lt;IfModule mod_geoip.c&gt;\nRewriteEngine On\nRewriteCond %{ENV:GEOIP_COUNTRY_CODE} !^(TR)$\nRewriteRule ^(.*)$ - [F,L]\n&lt;\/IfModule&gt;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Turkiye_Disina_Erisim_Engelle_Fakat_Google_ASNye_Izin_Ver\"><\/span>T\u00fcrkiye D\u0131\u015f\u0131na Eri\u015fim Engelle Fakat Google ASN&#8217;ye \u0130zin Ver<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>T\u00fcrkiye d\u0131\u015f\u0131na eri\u015fim engelleme kodunu aktif etti\u011finizde Google botlar\u0131 internet sitenize eri\u015femeyecektir. Bu nedenle Google botlar\u0131n\u0131n indekslemelerini engellemeden \u00e7al\u0131\u015fmas\u0131n\u0131 isterseniz a\u015fa\u011f\u0131da bulunan kodlar\u0131 kullanabilirsiniz.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">&lt;IfModule mod_geoip.c&gt;\nRewriteEngine On\n\nRewriteRule ^ - [E=TR_DISI:False]\n#TR d\u0131\u015f\u0131n\u0131 engelle\nRewriteCond %{ENV:GEOIP_COUNTRY_CODE} !^(TR)$\nRewriteRule ^ - [E=TR_DISI:True]\n\nRewriteRule ^ - [E=ISP_NOT:False]\n#Google ASN Number'a izin ver\nRewriteCond %{ENV:GEOIP_ISP} !^(15169)$\nRewriteRule ^ - [E=ISP_NOT:True]\n\n#Yukar\u0131daki t\u00fcm ko\u015fullar mevcutsa 403 yasak ver\nRewriteCond %{ENV:TR_DISI} =True\nRewriteCond %{ENV:ISP_NOT} =True\nRewriteRule ^(.*)$ - [F,L]\n&lt;\/IfModule&gt;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Belirli_Bir_Ulkeye_Erisimi_Engelleme\"><\/span>Belirli Bir \u00dclkeye Eri\u015fimi Engelleme<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\"># A\u015fa\u011f\u0131daki b\u00f6l\u00fcm Fransa ve Almanya eri\u015fimlerini yasaklar\n&lt;IfModule mod_geoip.c&gt;\nRewriteEngine On\nRewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^(FR|DE)$\nRewriteRule ^(.*)$ - [F,L]\n&lt;\/IfModule&gt;<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\">ASN Bloke Kurallar\u0131<\/h1>\n\n\n\n<p>\u00dclke engellemeleri d\u0131\u015f\u0131nda belirlemi\u015f oldu\u011funuz ISP&#8217;lerden internet sitenize eri\u015fimi engellemek isterseniz a\u015fa\u011f\u0131da iletmi\u015f oldu\u011fumuz kodlar\u0131 kullanabilirsiniz. Engellemek istedi\u011finiz ISP&#8217;nin ASN numaras\u0131n\u0131 buradan \u00f6\u011frenebilirsiniz: <a href=\"https:\/\/dnslytics.com\/search?q=\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">https:\/\/dnslytics.com\/search?q=<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Ornek_1_%E2%80%93_OVH_ISPsinden_Erisimleri_Engelleme\"><\/span>\u00d6rnek 1 &#8211; OVH ISP&#8217;sinden Eri\u015fimleri Engelleme<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">&lt;IfModule mod_geoip.c&gt;\nRewriteEngine On\nRewriteCond %{ENV:GEOIP_ISP} !^(16276)$\nRewriteRule ^(.*)$ - [F,L]\n&lt;\/IfModule&gt;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Ornek_2_%E2%80%93_Hetzner_ISPsinden_Erisimleri_Engelleme\"><\/span>\u00d6rnek 2 &#8211; Hetzner ISP&#8217;sinden Eri\u015fimleri Engelleme<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">&lt;IfModule mod_geoip.c&gt;\nRewriteEngine On\nRewriteCond %{ENV:GEOIP_ISP} !^(24940)$\nRewriteRule ^(.*)$ - [F,L]\n&lt;\/IfModule&gt;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Ornek_3_%E2%80%93_Her_Iki_ISPden_Erisimi_Engelleme\"><\/span>\u00d6rnek 3 &#8211; Her \u0130ki ISP&#8217;den Eri\u015fimi Engelleme<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">&lt;IfModule mod_geoip.c&gt;\nRewriteEngine On\nRewriteCond %{ENV:GEOIP_ISP} !^(16276|24940)$\nRewriteRule ^(.*)$ - [F,L]\n&lt;\/IfModule&gt;<\/code><\/pre>\n\n\n\n<p>&nbsp;<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>\u0130nternet sitenize gelen siber sald\u0131r\u0131lara kar\u015f\u0131 g\u00fcvenlik sa\u011flamak veya ki\u015fisel tercihlerinizden dolay\u0131 di\u011fer \u00fclkelerden internet sitenize eri\u015filmesini engellemek istiyor olabilirsiniz.&nbsp; Domainhizmetleri Web Hosting&#8217;lerinde T\u00fcrkiye D\u0131\u015f\u0131na Eri\u015fimi Engelleme A\u015fa\u011f\u0131da iletmi\u015f oldu\u011fumuz kodlar\u0131, projenizin k\u00f6k dizini (public_html) i\u00e7indeki .htaccess dosyan\u0131z i\u00e7erisine ekleyerek T\u00fcrkiye d\u0131\u015f\u0131ndaki t\u00fcm \u00fclkelerden internet sitenize eri\u015fimi engelleyebilirsiniz. T\u00fcrkiye D\u0131\u015f\u0131na Eri\u015fim Engelle Fakat Google ASN&#8217;ye [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":3697,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[143,142],"tags":[108,107,24,18],"class_list":["post-3667","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-domain-hosting","category-yazilim-pratikleri","tag-country-code","tag-ip-engelleme","tag-linux","tag-php"],"views":3556,"_links":{"self":[{"href":"https:\/\/www.domainhizmetleri.com\/blog\/wp-json\/wp\/v2\/posts\/3667","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.domainhizmetleri.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.domainhizmetleri.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.domainhizmetleri.com\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.domainhizmetleri.com\/blog\/wp-json\/wp\/v2\/comments?post=3667"}],"version-history":[{"count":36,"href":"https:\/\/www.domainhizmetleri.com\/blog\/wp-json\/wp\/v2\/posts\/3667\/revisions"}],"predecessor-version":[{"id":6231,"href":"https:\/\/www.domainhizmetleri.com\/blog\/wp-json\/wp\/v2\/posts\/3667\/revisions\/6231"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.domainhizmetleri.com\/blog\/wp-json\/wp\/v2\/media\/3697"}],"wp:attachment":[{"href":"https:\/\/www.domainhizmetleri.com\/blog\/wp-json\/wp\/v2\/media?parent=3667"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.domainhizmetleri.com\/blog\/wp-json\/wp\/v2\/categories?post=3667"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.domainhizmetleri.com\/blog\/wp-json\/wp\/v2\/tags?post=3667"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}