Hotlinking Kya Hai? Image Protection Kaise Kare .htaccess Se

What is hotlinking? Hot linking kya hai is bare me shayad bahut kam blogger jante hai. Jab koi user aapki post ke content ya only images ko copy kar ke apne blog par paste karta hai to usme image aapki site ke url se hi open hoti hai or aapke server se hi load hoti hai. Ise technical language me hotlinking kahte hai. Isse aapko na sirf copy pasting ki problem hoti hai balki isse aapko web hosting bandwidth ki pareshani bhi hoti hai.

protect hotlinking via htaccess

Actually bahut se log humare article ko direct fully (all content with images) copy kar lete hai. Jisme use hone wali sabhi image humare hosting server ke dwara hi load hoti hai. Is wajah se bekar me aapki web hosting ka bandwidth kharch hota hai.

What is hotlinking Kya Hai?

For newbie people, Jab koi aapki site ki image ko chura par apni site par use karta hai or jab koi uski site ko open karta hai to wo image aapke hi hosting server par load hoti hai. Ise hi technically bhasha me hotlinking kahte hai.

Simple words me kisi ke dwara aapki image ko copy kar apni site par add karne or aapke web hosting bandwidth ko use karne ki process ko image hotlinking kaha jata hai.

Jitni bar user unki site ko open karenge utni bar hi image aapke server se load hongi Ise hi image hotlinkg kahte hai. Is se aapko koi fayda nahi hai sirf nuksan hi hai. Ek to log aapki site ki image chori kare or upar se aapke hi server ka fayda bhi uthaye. So agar aap chaho to hotlink ko .htaccess file ki help se block kar sakte ho.

How to Prevent Image hotlinking using .htaccess on WordPress

Aap WordPress blog me .htaccess file ki help se image hotlink ko protect kar sakte ho. Iske liye aapko .htaccess file me code add karna hoga uske bad koi aapki site ki image ko apni site par use karega to image ki jagah error show hoga.

WordPress par aap .htaccess use kar ke site ko allow, block, referral link ko redirect and site ko protect kar sakte ho. Iske liye bas aapko apne hosting cPanel par ek .htaccess ke name se file create karni hoti hai. WordPress site par ye already bani hoti hai.

Iske liye aap apne hosting cpanel >> file manager >> public_html option me jaye ya fir aap yoast SEO plugin use karte ho to WordPress dashboard >> SEO >> Tools >> File editer me ja kar .htaccess file open kar sakte ho.

Ab aapko .htaccess file me ye code add karna hai.

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yoursite.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?youranothersite.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?youranothersite.com [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ https://i.imgur.com/removed.png [NC,R,L]

Isme aapko 2-3  specific website add karni hai. I mean aap yaha jin sites ke URL add karoge sirf unhi par image show hogi. baki sabhi sites par aapki iamge show nahi hogi. Yaha aapko apni site or other kuch sites ke URL add akrne hai jin par aap is site ki image use karte ho.

Hotlink Ko Protect Karne Ke Liye .htaccess File Me Code Kaise Use Kare?

Agar aapko upar diya code kis tarah .htaccess file me use karna hai samajha nahi aa raha hai to chaliye main iske bare mbhi aapko detail se bta deta hu. Upar btaye code me total 6 line hai.

1. RewriteEngine on

Ye code .htaccess ko active and order dene ke liye hota hai. Agar aapke blog par already .htaccess file hai to ye line pahle se file me add hogi or aapko fir se ye line add karne ki jarurat nahi hai or agar aap first time .htaccess edit kar rahe hai to aapko ye line add karni hogi.

2. RewriteCond %{HTTP_REFERER} !^$

Ye line bank referer ko allow karti hai. Jisse aap yaha jo site link add karoge only unhi par image show hogi.

3. RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yoursite.com [NC]
4. RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?youranothersite.com [NC]
5. RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?youranothersite.com [NC]

Three, four and five line me aapko un sites ko add karna hai jin par aap image dikhana chahate ho. First aapko apni site ka link add karna hai. Inke alawa baki kisi bhi site par apaki image ka link dalne par photo show nahi honge. So aap yaha apni kuch or sites bhi add akr sakte ho.

6. RewriteRule \.(jpg|jpeg|png|gif)$ https://i.imgur.com/removed.png [NC,R,L]

Sixth line me aapko error image add ka link add karna hai. I mean jab koi aapki site ki image ka link use karega to waha aap koi bhi image show kar sakte ho. Iske liye aap apni site ki umage use mat karna balki koi error page ka link add kar dena.

Finally, ab aapko sabkuch samajh aa gaya hoga. Example ke liye aap mere WordPress blog ka hotlinking protection code dekh sakte ho.

SMI hotlink htaccess blocker code

Isi tarah aap is link me se domain change kar ke hotlinking ko bloack kar sakte hai or apni site ko protect kar sakte hai. .htaccess file me code add karne ke bad check kar le ki aapki site sahi se work kar rahi hai ya nahi.

Please share this post.

Avatar for Jumedeen Khan

मैं इस ब्लॉग का संस्थापक और एक पेशेवर ब्लॉगर हूं। यहाँ पर मैं नियमित रूप से अपने पाठकों के लिए उपयोगी और मददगार जानकारी शेयर करता हूं। ❤️

Comments ( 36 )

  1. Bro do sawal...
    1. Kya aapne hotlinking ko enable kiya hai?
    2. I know isse page speed increase hoti hai. Lekin isse koi SEO efeect to nahi hai nah.

    Reply
    • 1. Nahi
      2. Yea, agar aap chahate ho ki kuch blogs aapki image use kare to iska use mat karo.

      Reply
  2. Hello bhai meri site merihindijankari.in hai mai WordPress pr site banana hu to sir mujhe koun sa hosting le jo sabse better ho aur aap kaun sa use karte ho plz bataye sir

    Reply
    • Abhi aapki staritng hai to aap shared hosting use karo. Iske liye aap hostgator india ya bluehost india se hosting le sakte ho. Dono hi shared hosting ki better service hai or agar aapke pas credit card hai to aap hostgator.com se hosting buy kar sakte ho.

      Reply
  3. meri website ki image crash ho ja rahi thi isi liyee main WordPress ko uninstall kar ke fir se server pe instal kya. ab naye post ko webmaster me submit kr raha hu. or sitemap me jakar xml submit karne ke baad error aa rha . to mujhe kya krna padega. Ak baar kr diya submit to ho gaya ya fir again krna padega. q ki submit, indesx ki details mere google consol me show nahi kara raha

    Reply
    • Aap first yoast SEO plugin use karke first sitemap create karo. uske bad submit karo.

      Reply
  4. Bahut hi umda jankari pesh ki hai aapne. Is behatrin post ke liye aapka bahut bahut dhnybad.

    Reply
  5. Hotlinks plugin is very dangrous

    mene apni 1 site pr use kri thi nd than meri site penalize ho gyi 🙂

    Reply
    • apne galat code use kiya hoga.

      Reply
      • sir isme code kaise

        Hotlink plugine active krdo and kaam khatam

        mere pass webmaster mai mail aya tha penalize wala usdin se plugine use krna bnd

        bahut nuksan kar diya google ne event blog mai use karta tha sab bnd

        Reply
        • Himanshu plugin use karna danger ho sakta hai. Aapko koi bhi pro blogger jyada plugin use karne ki advice nahi deta hai. Ho sakta hai aapne galat plugin use kiya ho. Secong hotlinking bhi SEO ke liye danger ho sakti hai.

          Reply
  6. cpc ke liye low cpc site ko block kar de to koi problem tp nhi hogi...

    Reply
    • Nahi nahi hogi.

      Reply
  7. Bro! Aap koi backup plugin use karte ho SMI ke liye. Best plugin name please ?

    Reply
    • Nahi mai direct cpanel se backup leta hu.

      Reply

Leave a Comment

×