好!欢迎访问迷津渡口 现在时间是: 天气 °C ~ °C

迷津渡口

越感到迷惑 越接近真理

.htaccess设置禁止某几个ip访问-重定向-静态缓存

最近有几个恶心的ip,小指指头都想破了,终于发现可以使用.htaccess禁止访问。

但是网上很多都是错的,apache 2.4和以前的版本又不一样:官网说明

<RequireAll>
Require all granted
Require not ip 180.97.106.36 180.97.106.37 180.97.106.161 180.97.106.162
</RequireAll>

额,把ip贴出来了,不好意思啦。。。

另外小指还发现了htaccess有非常强大的作用:

重定向non-www到www:

<IfModule mod_rewrite.c>
RewriteEngine on

RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>

添加静态缓存

<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault A86400
ExpiresByType image/x-icon A2592000
ExpiresByType application/x-javascript A2592000
ExpiresByType text/css A2592000
ExpiresByType image/gif A604800
ExpiresByType image/png A604800
ExpiresByType image/jpeg A604800
ExpiresByType text/plain A604800
ExpiresByType application/x-shockwave-flash A604800
ExpiresByType video/x-flv A604800
ExpiresByType application/pdf A604800
ExpiresByType text/html A900
</IfModule>

还有好多但是个人不实用,而且最好不要添加太多,否则网站会变慢,所以小指就不贴了,需要的自己百度吧~

最后感谢帮助小指的大神^_^记得点赞哦~

点赞0
   支持一下
挤眼 亲亲 咆哮 开心 想想 可怜 糗大了 委屈 哈哈 小声点 右哼哼 左哼哼 疑问 坏笑 赚钱啦 悲伤 耍酷 勾引 厉害 握手 耶 嘻嘻 害羞 鼓掌 馋嘴 抓狂 抱抱 围观 威武 给力
 点赞
 签到
 表情
 图片
 代码
提交评论

清空信息
关闭评论
kelownariders
 kelownariders 约 20 小时前回复
#270
<a href="http://www.akimmobilien.com/hombres-supra-bleeker-oro-p%C3%BArpura-chaussuresb">hombres supra bleeker oro p煤rpura</a> <a href="http://www.swbvideo.com/flyknit-air-max-rosa-orange-jordans-zapatosj">flyknit air max rosa orange jordans</a> <a href="http://www.fabaliworld.com/nike-air-max-thea-kvinders-guld-himmelbl%C3%A5-obuvf">nike air max thea kvinders guld himmelbl氓</a> <a href="http://www.poliwalks.com/pandora-bracelets-auction-expert-pandoraj">pandora bracelets auction expert</a> <a href="http://www.docaneurope.com/nike-hypervenom-rot-rosa-trainersd">nike hypervenom rot rosa</a> <a href="http://www.darwinquartet.com/converse-slippers-price-chaussuresm">converse slippers price</a>
kelownariders http://www.kelownariders.com/
threeoaksmi
 threeoaksmi 2019-12-14 16:03回复
#269
<a href="http://www.floozyspeak.com/canada-goose-trillium-parka-6550l-canadagooser">canada goose trillium parka 6550l</a> <a href="http://www.rapamateur.com/mens-nike-new-orleans-saints-23-marshon-lattimore-limited-olivecamo-2017-salute-to-service-nfl-jersey-nflz">mens nike new orleans saints 23 marshon lattimore limited olivecamo 2017 salute to service nfl jersey</a> <a href="http://www.sarkariresurt.com/nobis-vest-uk-house-nobisb">nobis vest uk house</a> <a href="http://www.checkmyprices.com/nike-air-force-1-denim-low-footc">nike air force 1 denim low</a> <a href="http://www.oriturk.com/tory-burch-boots-size-12-toryburchr">tory burch boots size 12</a> <a href="http://www.parasolphoto.com/herren-nike-huarache-utility-gold-gr%C3%BCn-butyd">herren nike huarache utility gold gr眉n</a>
threeoaksmi http://www.threeoaksmi.com/
zanascuisine
 zanascuisine 2019-12-14 07:16回复
#268
<a href="http://www.goeaglepointe.com/mackage-matos-satchel-handbag-design-mackagef">mackage matos satchel handbag design</a> <a href="http://www.jewelsavers.com/white-leather-converse-shoesz">white leather converse</a> <a href="http://www.minsonphoto.com/nike-air-max-90-essential-grau-naranja-kurpesg">nike air max 90 essential grau naranja</a> <a href="http://www.nhealthtips.com/dez-bryant-platinum-jersey-nflt">dez bryant platinum jersey</a> <a href="http://www.purchasemenu.com/nike-kobe-8-kvinders-gr%C3%B8n-runningd">nike kobe 8 kvinders gr酶n</a> <a href="http://www.roidezign.com/nike-air-max-95-triple-black-xt-runningd">nike air max 95 triple black xt</a>
zanascuisine http://www.zanascuisine.com/
sanduicheria
 sanduicheria 2019-12-14 05:04回复
#267
<a href="http://www.xzibitmalta.com/parajumpers-denali-jakke-ops-parajumpersa">parajumpers denali jakke ops</a> <a href="http://www.genericpreset.com/moncler-down-jacket-hymalay-uk-monclera">moncler down jacket hymalay uk</a> <a href="http://www.bootberlin.com/herren-zx-700-schuhe-chaussuresb">herren zx 700 schuhe</a> <a href="http://www.diettucson.com/air-jordan-retro-5-kvinners-s%C3%B8lv-rosa-zapatosj">air jordan retro 5 kvinners s酶lv rosa</a> <a href="http://www.schockenkatz.com/adidas-ultra-boost-royal-azul-obuvf">adidas ultra boost royal azul</a> <a href="http://www.drrandtherapy.com/pandora-jewelry-at-disney-springs-pandoraj">pandora jewelry at disney springs</a>
sanduicheria http://www.sanduicheria.com/
chrissinacori
 chrissinacori 2019-12-13 10:32回复
#266
<a href="http://www.raiedumacon.com/air-max-95-new-release-2014-footc">air max 95 new release 2014</a> <a href="http://www.renitemare.com/air-jordan-6-retro-hombres-zapato-barato-flights-kurpese">air jordan 6 retro hombres zapato barato flights</a> <a href="http://www.solidgoldpay.com/adidas-neo-mesh-hvid-gr%C3%B8n-kurpese">adidas neo mesh hvid gr酶n</a> <a href="http://www.hiussalipiilo.com/elite-white-max-unger-c-patch-road-jersey-60-seattle-seahawks-nk281307-nflb">elite white max unger c patch road jersey 60 seattle seahawks nk281307</a> <a href="http://www.redstonecloud.com/hermes-wallet-bearn-price-book-hermesa">hermes wallet bearn price book</a> <a href="http://www.scarystate.com/asics-gel-kinsei-2-laufen-schuhe-herren-online-chaussuresd">asics gel kinsei 2 laufen schuhe herren online</a>
[url=http://www.chrissinacori.com/]chrissinacori[/url]
hiussalipiilo
 hiussalipiilo 2019-12-09 15:24回复
#265
<a href="http://www.pulselocums.com/jordan-4-gr%C3%B8nn-glow-gr%C3%A5-chaussuresf">jordan 4 gr酶nn glow gr氓</a> <a href="http://www.eniszczarki.com/nike-air-max-womens-dark-blue-footc">nike air max womens dark blue</a> <a href="http://www.gradualdesing.com/tory-burch-black-leather-wallet-toryburchr">tory burch black leather wallet</a> <a href="http://www.sigaldavid.com/hermes-birkin-30-gold-togo-hermesr">hermes birkin 30 gold togo</a> <a href="http://www.mindteez.com/adidas-john-wtutti-3-gituttio-viola-obuva">adidas john wtutti 3 gituttio viola</a> <a href="http://www.synthcourses.com/adidas-neo-scarpe-ladies-obuvc">adidas neo scarpe ladies</a>
hiussalipiilo http://www.hiussalipiilo.com/
videobind
 videobind 2019-12-09 09:13回复
#264
<a href="http://www.whatiownapp.com/herren-asics-gel-sendai-2-wei%C3%9F-rosa-trainersd">herren asics gel sendai 2 wei脽 rosa</a> <a href="http://www.veronafabric.com/nike-flyknit-air-vapormax-lila-silber-chaussuresm">nike flyknit air vapormax lila silber</a> <a href="http://www.votejohndavis.com/ralph-lauren-short-sleeve-poplin-shirt-nz-poloa">ralph lauren short sleeve poplin shirt nz</a> <a href="http://www.stillbaymotel.com/roshe-run-floral-space-bleu-scarpek">roshe run floral space bleu</a> <a href="http://www.ecosphereasi.com/floral-dresses-dubai-dresse">floral dresses dubai</a> <a href="http://www.dacsud.com/nike-zoom-clear-out-1-bianca-marrone-footi">nike zoom clear out 1 bianca marrone</a>
videobind http://www.videobind.com/
usuariobacano
 usuariobacano 2019-12-08 04:43回复
#263
<a href="http://www.getleanlearn.com/nike-acg-foamposite-boots-schwarz-obuve">nike acg foamposite boots schwarz</a> <a href="http://www.esterbed.com/burberry-large-check-cashmere-scarf-scarfr">burberry large check cashmere scarf</a> <a href="http://www.hvactampafl.com/ralph-lauren-polo-aftershave-set-australia-poloa">ralph lauren polo aftershave set australia</a> <a href="http://www.intotheglos.com/nike-air-foamposite-one-premium-atomic-r%C3%B8d-hvit-svart-obuvc">nike air foamposite one premium atomic r酶d hvit svart</a> <a href="http://www.wsphotel.com/parajumpers-coat-shoes-valentino-parajumpersb">parajumpers coat shoes valentino</a> <a href="http://www.peoplesbit.com/oakley-frogskins-sunglasses-outlet-sunglassesr">oakley frogskins sunglasses outlet</a>
usuariobacano http://www.usuariobacano.com/
usuariobacano
 usuariobacano 2019-12-07 17:54回复
#262
<a href="http://www.kellyalberto.com/hermes-wallet-made-in-france-2014-hermesg">hermes wallet made in france 2014</a> <a href="http://www.magaview.com/dam%C3%A4nner-nike-air-max-2016-gold-rosa-chaussurese">dam盲nner nike air max 2016 gold rosa</a> <a href="http://www.wtcrosario.com/jordan-12-legend-blue-xii-shoese">jordan 12 legend blue xii</a> <a href="http://www.artoccsr.com/ray-ban-classic-wayfarer-50mm-polarized-sunglasses-sunglassesr">ray ban classic wayfarer 50mm polarized sunglasses</a> <a href="http://www.littlehaleh.com/nike-mercurial-vapor-ix-blau-volt-butyd">nike mercurial vapor ix blau volt</a> <a href="http://www.lubimochka.com/air-max-1-bleu-anniversary-butya">air max 1 bleu anniversary</a>
usuariobacano http://www.usuariobacano.com/
acductwork
 acductwork 2019-12-06 19:31回复
#261
<a href="http://www.marionnurses.com/marshalls-ralph-lauren-polo-shirts-poloa">marshalls ralph lauren polo shirts</a> <a href="http://www.duracordstyle.com/tout-rouge-kd-7-global-game-scarpek">tout rouge kd 7 global game</a> <a href="http://www.paoniabud.com/jakke-med-rosa-blomster-kjoler-dresse">jakke med rosa blomster kjoler</a> <a href="http://www.elginger.com/jordan-5-bl%C3%A5-and-r%C3%B8d-footi">jordan 5 bl氓 and r酶d</a> <a href="http://www.purelygadget.com/mens-nike-air-max-1-black-butyg">mens nike air max 1 black</a> <a href="http://www.caraweston.com/parajumpers-light-long-bear-eco-quests-parajumpersb">parajumpers light long bear eco quests</a>
acductwork http://www.acductwork.com/
顶部留言底部
 00:00/00:00
我想和你虚度时光 - 花房姑娘(9)
  1. 我想和你虚度时光
  2. 花房姑娘
  3. 恋恋风尘
  4. 我喜爱一切不彻底的事物
  5. 我的心里是满的
  6. Long Way
  7. 给少年的歌
  8. 晴日共剪窗
  9. 天上的月你的脸