Stop other websites from Hotlinking images, will this affect my Android App?

Posted on 2011-10-10
Last Modified: 2014-01-27
I have a website and an android app. The android app displays pictures from the website. I want to stop other people from hotlinking my images (which they are currently doing) but I am unsure if it will make my android app stop working.

It seems that most solutions use .htaccess to stop image hot linking, and I have done this in the past but I am worried that my android app will stop working if I implement this. What is the referer from an android appliaction? Has anyone done something similar?
Question by:jrm213jrm213
    LVL 77

    Assisted Solution

    by:David Johnson, CD, MVP
    it depends upon HOW you coded the android app.. it probably will work just fine.. and the referrer is probably the link on your site and not a direct link to the image (some programs allow you to modify the referrer
    as a test just modify your htaccess so it only affects a small subset of the pictures (you can create a test folder and add a few images there as a test) and see what the results are. That way you know for sure.
    LVL 9

    Accepted Solution

    you can use the .htaccess with rewrite checking the OS send in the http header. It's not an ideal solution but at least limit the hotlinking

    something like this

    RewriteCond %{HTTP_USER_AGENT} ^.*(Android).*$ [NC]
    RewriteRule ^(.+)$ /images-android/$1 [L]
    LVL 17

    Author Comment

    I apologize, I have not had time to work on this yet. It isn't a priority here but it is something we want to figure out, so hopefully I will have time to work on this soon.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Introduction This article is a continuation of Part-1 as evident from the title. Please visit this page ( to read the earlier Part -1. If y…
    Once again I push the limits of my phone.  An introduction to the Android Google Now Launcher.
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now