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

About Jumedeen Khan

I'm the founder of this site and we regularly share useful and helpful information here for beginners. ❤️

Reader Interactions

Comments (36)

  1. Avatar for Rushikesh SonawaneRushikesh Sonawane

    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.

    • Avatar for Jumedeen khanJumedeen khan

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

  2. Avatar for Rishikesh MishraRishikesh Mishra

    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

    • Avatar for Jumedeen khanJumedeen khan

      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.

  3. Avatar for princeprince

    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

    • Avatar for Jumedeen khanJumedeen khan

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

  4. Avatar for Prakash RajPrakash Raj

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

  5. Avatar for Himanshu GrewalHimanshu Grewal

    Hotlinks plugin is very dangrous

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

    • Avatar for Jumedeen khanJumedeen khan

      apne galat code use kiya hoga.

      • Avatar for Himanshu GrewalHimanshu Grewal

        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

        • Avatar for Jumedeen khanJumedeen khan

          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.

  6. Avatar for Kuldeep VishnoiKuldeep Vishnoi

    cpc ke liye low cpc site ko block kar de to koi problem tp nhi hogi…

    • Avatar for Jumedeen khanJumedeen khan

      Nahi nahi hogi.

  7. Avatar for Sanjay Singh RawatSanjay Singh Rawat

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

    • Avatar for Jumedeen khanJumedeen khan

      Nahi mai direct cpanel se backup leta hu.

  8. Avatar for Babita SinghBabita Singh

    Thanks Jumedeen ji, for updating about hotlinking. I will surely try to use it in protecting my site.

    khayalrakhe.com

    • Avatar for Jumedeen khanJumedeen khan

      Welcome babita, also share it.

  9. Avatar for Yasir khanYasir khan

    Hame blog ki fast indexing ke liye kitne ping url use karne chahiye?
    4-6
    50-60?

    • Avatar for Jumedeen khanJumedeen khan

      Kam se kam 4-5 bhi maximum hai.

  10. Avatar for Naresh saharanNaresh saharan

    Bahut achhi jankari di apne. Kya image churane se wo copyright nahi jo jati h kya .

    • Avatar for Jumedeen khanJumedeen khan

      Yes copyright hoti hai.

  11. Avatar for NekrajNekraj

    Kaafi acchi post ,will change these file .[though I am not a tech guys but still try to

  12. Avatar for AskarAskar

    blog main login. singup. regstr . a sab kese lagati hain …
    plz batangy kia

  13. Avatar for DeepakDeepak

    Hlw sir aap pls mujhe ye btaye ki aapki post ke side me jo yeh social share widget hai. bo aapne kaise lagaye hai? or kha se lgaye hai?

    • Avatar for Jumedeen khanJumedeen khan

      Coding se bana kar.

  14. Avatar for Anup SahuAnup Sahu

    ek or problem bhai new template use krne ke bad only old post search me show kar rhe hai template ko upload kiye bhut din ho gya hai kya problem ho skta hai

    • Avatar for Jumedeen khanJumedeen khan

      Template me aap meta code sahi se add karo. sabhi post search me aa jayegi.

  15. Avatar for Sahil KumarSahil Kumar

    बहुत समय बाद नई जानकारी पता चली, जुमेदीन भाई आप से अनुरोध के कि आप ज्यादा से ज्यादा वर्डप्रैस पर लिखें।

    भाई एक बात पूछनी थी, कि जब हर 2 तारीख को हमारी एडसेंस की कमाई फाइनल होती है तो क्या आपके भी Invalid Traffic के डॉलर कटते है?

    अगर कटते है तो लगभग कितने?

    • Avatar for Jumedeen khanJumedeen khan

      Ha bilkul hoti hai. $5 to $10.

  16. Avatar for Jahid AnowarJahid Anowar

    Vai mene ek khud cms create kiya or agar me hotlinks protect karna chata hu to kya apke above code ko use karo?

    • Avatar for Jumedeen khanJumedeen khan

      yes kar sakte ho.

  17. Avatar for Ravi KumarRavi Kumar

    Bro plz bataye ki 500-700 wali post mein kitne ads use karu, Mujhe Aapne pehle post padhne ko kaha tha lekin mujhe usey padhne ke baad answer nahi mila aap khud bata do kitne use karu acche cpc ke liye

    • Avatar for Jumedeen khanJumedeen khan

      Uffs!!!!! 1000 words se kam words ki post me only 1-2 ads hi use karo.

      • Avatar for rishirishi

        Sir g kya aap is samay online ho?

        • Avatar for Jumedeen khanJumedeen khan

          Aap mujhse sham 8 baje facebook par live chat kar sakte ho.

Add a Comment

Your email address will not be published. Required fields are marked *

I need help with ...