±M·~«Ç¤º¸ËæC³]p¡B«ν·s ¿Ä¦X¬ü·P»P¹ê¥Î¡A¥þ±Àç³y·ÅÄɦn¦v¡I | ¥þ¬ÙºûצU¤j«~µP§N®ð¡A¤£§N¡B¤£¶}¾÷¡B²§Án¦ÛÃö¾÷ §N®ð¾÷ºûסB¦w¸Ë¡B«O¾i¡AÅwªï¨Ó¹q¬¢½Í¬Ò¥i¬¢¸ß |
¨î¹Ï¤ù¥~³s¥Î .htaccess Àɮײ£¥Í¾¹ |
©ÐªF¡GÀsÀs µoªí®É¶¡¡G2007-01-18 |
¤@¯ëÀW¼e¦³ªº½×¾Â³£§Æ±æ¹Ï¤ù¤£n¥~³s¡A¦Ó§@ªk¬O«Ø¥ß¤@Ó .htaccess Àɮשñ¦b½×¾Â¥Ø¿ý¤U ©³¤U³o¤@Ó³sµ²¬OÀ°§U§A²£¥Í .htaccess ÀɮץΪº http://www.htmlbasix.com/disablehotlinking.shtml |
|
1 ¼Ó¦í¤á¡G°ª¤â µoªí®É¶¡¡G2007-01-27 |
¥Î mod_rewrite ¨¾¤î°½¹Ï¥H«e§Ú¦³¤@¦ì«È¤á¡A¥Lªººô¯¸¬y¶q¤Q¤À¤j¡A¸g¹LÀˬd«áµoı¤j³¡¥÷ªº¬y¶q³£¥Î¦b¹Ï¤ù¤W¡A³o¤]µL¥i«p«D¡A¥Lªº¹Ï¤ù¸Ñ¹³«×¤ñ¸û°ª¡A¦ý¥t¤@Óì¦]¬O¦³¤H¦b¨ä¥L½×¾Â¶K¤W¥Lªº¹Ï¤ù¡A¦Ó¶K¹Ïªº¤èªk¬Oª½±µ¨Ï¥Î¥Lªº¹Ï¤ù³sµ²¡C§Ú°Ý¹L¥Lªº·N¨£¡A¥L¤£¤¶±§O¤H¶K¥X¥Lªº¹Ï¤ù¡Aª½±µ¤U¸ü¹Ï¤ù¦A«·s¤W¸üªº¸Ü¨S¦³°ÝÃD¡A¦]¬°¨C±i¹Ï¤ù¤]¦³¥X²{¥Lªººô¯¸¦WºÙ¡A¥u¬O¤£·Q¤H®a®ö¶O¤F¥Lªº¬y¶q¡C µM«á§Úı±o¥Î mod_rewrite ¬O¸û¤è«Kªº°µªk¡A¦Ó¦pªG§Aªººô¯¸¤]¤ä´© mod_rewrite ¥\¯à¡A¦b .htaccess ¥[¤W¥H¤U¤º®e¡A¤]¥i¨¾¤îµ¹§O¤H°½¹Ï: RewriteEngine On RewriteCond %{HTTP_REFERER} ^http://www.anotherwebsite.com/.*$ [NC] RewriteRule ^/img/indieband\.jpg$ http://www.mydomain.com/nkotb.jpg [R] ¥H¤Wªº²Ä¤@¦æ¬O¶}©ñ RewriteEngine¡A¦pªG§Aªº .htaccess ¤w¸g¦³³o¤@¦æ´N¤£¥Î¥[¤W¡F²Ä¤G¦æ¬O¨ä¥Lºô¯¸ªººô§}¡F²Ä¤T¦æ¬O±N /img/indieband.jpg ¾É¦V /nkotb.jpg¡A¦Ó³oÓ /nkotb.jpg ¥i¥H¬O»¡©ú¹Ï¤ù¥X³Bªº¹Ï¤ù¡C |
2 ¼Ó¦í¤á¡G°ª¤â µoªí®É¶¡¡G2007-01-27 |
²©ö§@ªk ¦bServer¤W³]©wReferer¨¾°ô¡A «Ü¦h¤Hª¾¹Dn¦b.htaccess¤W°Ê¤â¸}¡A³]©w SetEnvIfNoCase Referer "^http://([^/]*\.)?your.server.name/" local_referrer=1 Order Allow,Deny Allow from env=local_referrer ´N¥i¥H®Ú¾ÚReferer¨¾¤îjpgµ¥Àɮ׳Qµs³s [½s¿è]»¡©ú ³]©w Apache mod_rewrite ¨Ó¨¾¤îmod_rewrite on ¶}±Ò .htaccess Åv 1.¶}±Ò httpd.conf 2.·j´M AllowOverride None¡A©Î¬O¥u·j´M AllowOverride ÃöÁä¦r 3. §â None §ï¦¨ ALL¡Aªí¥Ü§¹¥þ±µ¨ü .htaccess ùتº©Ò¦³Åv³]©w¡AµM«á¦sÀÉ ¼W¥[¥H¤U¤º®eªº .htaccess ÀÉ¡A©ñ¦bºô¯¸¥Ø¿ý¤U§Y¥i¡C RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://lym.fyman.idv.tw(.*) [NC] RewriteRule \.(jpg|jpeg|gif|css|swf|png|bmp|rar|zip|exe)$ - [F] ²Ä¤@¦æ¬°¶}±Ò RewriteEngine¡A¤G¤T¦æ³]©w¤¹³\ªº³s½u ²Ä¥|¦æ«h¬O±q¨ä¥L¦a¤è³s¶i¨Ó¥B¬O¨º¨ÇÀɦWªº¡A¬Ý¨ì403¿ù»~°T®§¡A¤]¥i¥H§ï¦¨Åã¥Ü«ü©wªº¹Ï¤ù¡C ©Î¬O¦bºô¯¸¥Ø¿ý¤Uªº .htaccess Àɤ¤¡B©Î httpd.conf Àɤ¤¥[¤J¤U¦C¤º®e§Y¥i¡G µ{¦¡½X SetEnvIfNoCase Referer "^http://yourdomain.com/" local_referrer=1 Order Allow,Deny Allow from env=local_referrer °O±o§â http://yourdomain.com/ ³o¤@¬q§ï¦¨¦Û¤vªººô¯¸ URL [½s¿è]±q³]©wÀɤU¤â ª`·N!¥»±Ð¾Ç¥u°w¹ïapacheµ{¦¡¬[³]ªº¥D¾÷¦³®Ä! ½Ðקï apache ¤¤ªº httpd.conf ½Ð§ä¨ì¤U¦C¤å¦r: Options All AllowOverride All קאּ: Options FollowSymLinks Includes AllowOverride AuthConfig Limit Order allow,deny Allow from all SetEnvIfNoCase Referer \"^http://www1.xxx.com/ (http://www1.xxx.com/)\" local_ref=1 SetEnvIfNoCase Referer \"^http://www2.xxx.com/ (http://www2.xxx.com/)\" local_ref=1 Order Allow,Deny Allow from env=local_ref ¨ä¤¤ªºhttp://www1.xxx.com/¬°±z±ý³]ªººô§},¥i¼W¥[´î¤Ö... ¦A¨ä¤¤ªº(gif|jpg|jpeg|JPG|GIF|JPEG)¤º¬°±ý³]ªºÀÉ®×°ÆÀɦW,±z¥i¦Û¦æקï! ¦ýn°O±o, ¦pªG§Aºô¶¤¤¦³¨Ï¥Î¨ä¥Lµ{¦¡¨Ó©I¥sµ´¹ï¸ô®|ªº¹Ï¤ù®É, ½Ð¤@«ßק令¬Û¹ï¸ô®|, §_«h¨º¨Ç¹Ï¤ù¤]·|Åܦ¨¤e¿N¥]ªº. |
©m¦W¡G | |||
§G§i¤º®e¡G | |||
¨ä¥L¿ï¶µ: | |||
|