How to prevent hotlinking to my images, but use them myself in my swf?

My swf uses the Loader class to load in .jpg files. For example, let's say that my swf is at www.mydomain.com/myswf.swf. One of jpgs I want to load is at www.mydomain.com/images/myimage.jpg. I use:
Loader.load(new URLRequest("http://www.mydomain.com/images/myimage.jpg))
...and I also have tried:
Loader.load(new URLRequest("/images/myimage.jpg))
with the same results.
Either one works fine, *until* I turn on hotlinking protection. On the Apache server hosting my site, I use a cPanel tool that changes the .htaccess file. (I can change the file directly but I have not done so yet.)
When I turn on the default hotlink protection, my swf no longer can load the jpg. No matter what URLs I put into the tool as acceptable referrers, this remains the case. I know the URLs are correct, because I can imbed the jpg with html on other html pages in any domain I put in as a referrer. So in my example, I have put "http://www.mydomain.com" in as an acceptable referrer, and in http://www.mydomain.com/index.html I have the line:
<img src="http://www.mydomain.com/images/myimage.jpg" />
...and it displays the image fine on the web page.
If I check the box on the hotlink protection tool labeled "Allow direct requests (ie. entering the url to an image in your browser)", things are improved: I have partial hotlink protection, and my swf can now load the jpg. However, this means anyone else can make and deploy a swf on any domain which also can load the jpg. Also, anyone who enters the address "http://www.mydomain.com/images/myimage.jpg" will also see the jpg.
I am hoping that someone with .htaccess savvy can tell me the magic code to allow a swf on my domain to load the external jpg, but still prevent any abuses, such as for a swf on a different domain to load the jpg, or for a user to enter the address to my jpg directly into a browser to view the jpg.
FWIW here is what my htaccess file looks like, changing it to fit my example:
RewriteEngine on
<IfModule mod_suphp.c>
suPHP_ConfigPath /home/stucco33
<Files php.ini>
   order allow,deny
   deny from all
</Files>
</IfModule>
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://www.mydomain.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.mydomain.com$      [NC]
RewriteRule .*\.(gif|png|bmp|swf|jpg|jpeg)$ - [F,NC]
(BTW This was discussed quite helpfully at http://forums.adobe.com/message/2111067#2111067 by the way. That is where I got the idea to allow direct requests.)
I'd greatly appreciate any help so I don't risk disaster by blindly experimenting with htaccess on my live site.
--Matt

Here's what my .htaccess file looks like. Don't know if it makes a difference, but all the rewrite engine commands are within an IfModule tag.
<IfModule mod_rewrite.c>
RewriteEngine on
# This condition would allow access from no referrer
# Remove the hash if needed
# RewriteCond %{HTTP_REFERER} !^$
# Allow access from mydomain.com and www.mydomain.com
RewriteCond %{HTTP_REFERER} !^http://(www.)?mydomain.com/.*$ [NC]
# Allow access from mydomain.com and www.mydomain.com on port 12854
RewriteCond %{HTTP_REFERER} !^http://(www.)?mydomain.com:12854/.*$ [NC]
# file types to control
RewriteRule \.(gif|jpe?g|png)$ - [F]
</IfModule>

Similar Messages

  • How to prevent printing of an Image

    I have an image control and i want to make it 'not so easy'
    to copy it. I very well understand 100% copy-prevention is not
    possible,
    So my questions are two, one specific and other general
    1. Specific : How to disable the print option from appearing
    / functioning that pops out when i right click on my image control
    2. General : How within flex this problem of preventing
    copying of an image in image control is tackled. Though i know
    nothing can be done about ctrl-printscreen.
    Many a thanks.

    Look into flash.ui.ContextMenu class. You can edit the
    context menu when the user right-clicks on stage. Anyways the user
    cannot download images within a SWF by right-clicking; unless you
    programmed it to behave like that.
    As for your general question, the user would have to
    decompile the SWF to retrieve an image. If you have your source
    code viewable, the user can also retrieve it there.
    And yes, ctrl+prt sc is unavoidable.

  • How to prevent Finder from asking permission to use Trash?

    All:  How can I prevent Finder from asking permission to use Trash?  This wasn't a problem until two weeks ago.  Now it is.
    Thanks

    Do not empty the Trash in the shell. That's both dangerous and unnecessary.
    1. Triple-click the line below to select it:
    ~/.Trash
    2. Right-click or control-click the highlighted line and select
    Services ▹ Show Info
    from the contextual menu.* An Info dialog should open.
    3. The dialog should show "You can read and write" in the Sharing & Permissions section. If that's not what it shows, click the padlock icon in the lower right corner of the window and enter your password when prompted. Use the plus- and minus-sign buttons to give yourself Read & Write access and "everyone" No Access. Delete any other entries in the access list.
    4. In the General section, uncheck the box marked Locked if it's checked.
    5. From the action menu (gear icon) at the bottom of the dialog, select Apply to enclosed items and confirm.
    6. Close the Info window and test.
    *If you don't see the contextual menu item, copy the selected text to the Clipboard (command-C). Open a TextEdit window and paste into it (command-V). Select the line you just pasted and continue as above.

  • How to prevent displaying un-corrected image during "Loading..." phase ?

    Is there an option for securely
    not displaying the un-corrected image ?
    (while browsing a large number of images - cache not a real option)
    In my not-so-slow system this ruins my
    personal touch secrets ( ;-) ) .
    Everyone can see my cropping/light adjustments etc.
    Am I alone ?

    Thanks Ian ... a pair of (transparent) glasses and a good bottle might also help !
    As I tried to explain
    preview cache can be huge (I didn't try to copy it from main system to demo laptop)
    and might not guarantee
    that an image will not be displayed "uncorrected".
    I'd prefer a blank placeholder during that "Loading..." phase.Personal choice.
    Would that be a bad idea ?
    BTW my workaround is an export+catalog but for me it defeats
    all the Lightroom DAM beauty.

  • How i prevent text converting into image when exporting as a HTML FORMAT IN ADOBE FIREWORKS?

    ]I am an architect and wants to design my basic website with minimum graphics.
    I am using coreldraw for graphics design but it is related to print (Hardcopies) and corel is not smart soft compared to adobe software.
    So, for web design, I started to learn Fireworks. After some practice, i m able to design web graphics in fireworks.
    But the main problem is that, when that page is exported into html format. All text were converted into Image and it is not useful.

    Fireworks was devdeloped to use with Dreamweaver. It's not a stand alone app for developing web pages. Adobe Muse might be more the kind of app you are looking for. First, however, Give this tutorial a try.
    http://www.adobe.com/devnet/fireworks/articles/css_export_rectangles.html

  • How to Prevent the Executing a Program but Allow to Run as Background Job?

    Hi All,
    I have an ABAB List Program. I need to restrict this program from executing. This has to always run as a Background Job. How do I check this condition in the program?
    Thanks,
    Kishan

    Check for the system variable SY-BATCH. If this field is 'X', then allow the execution of the program. If not then exit. Do this coding in the initialization event or start of selection.
    INITIALIZATION.
    IF sy-batch IS INITIAL.
      STOP.
    ENDIF.
    Manoj

  • How to sort and filter all images when using stacks?

    I have a project where all images are arranged in stacks. I have also gone through and given each image a rating or rejected it. Now I want to sort out and display only a certain selection of images, i.e. rejected images for deletion or four star images etc. But the selection filter only seems to work on the stack pick. Can I change this so that the filter works on all images, even if they are part of an open stack? If not, how could I else single out all the rejected ones and delete them? I don't want to break the stacks.

    The only current way to do this is via Smart Albums, as there is a checkbox at the bottom of the settings HUD: 'Ignore Stack Groupings'.
    Ian
    P.S. If you'd like to see this added to the regular search HUD (I know I would), please leave feedback at http://www.apple.com/feedback/aperture.html

  • How to import programmatically an APEX images file using workspace images option and CSS files to APEX?

    Oracle db 11gR2
    Oracle APEX 4.2.1
    Linux RHEL 6.3
    I am importing a images file programmatically into APEX.  And also a CSS file.
    I want to add an images file to my APEX instance but I want to choose the option -- workspace images --.  How does one do that programmatically via the APEX API e.g.?
    I don't want the images tied to an application within APEX.
    Does one do the same thing for CSS files that are imported to APEX?
    thx.

    This is interesting and helpful,  I use the following code to import my APEX database application and run it via SQL*Plus and it works fine for database applications -- what do I need to change/add/modify in order to load the images and CSS files?  NOTE: I want the images to be -- Workspace images -- not tied to any application.  Also, I need to handle the situation where the images and CSS data already exist in the APEX environment as well as when they are not there (i.e. initial install).  Usually it is a case where it is an upgrade so the data already exists in the APEX app and just needs to be updated.
    declare
                      v_workspace      varchar2(35)    := 'WORKSPACE';
                      n_existing_app   number          := 123;
                      n_new_app        number          := 456;
                      v_app_alias      varchar2(35)    := 'WKALIAS';
                      v_parsing_schema varchar2(35) :='WORKSPACE_PARSE';
                      n_secgrp_id      number;
                      v_err_msg        varchar2(200);
                      n_err_num        number;
                      n_workspace_id   number;
                    begin
                      -- get workspace id
                      select workspace_id
                      into n_workspace_id
                      from apex_workspaces
                      where workspace = v_workspace;
                      -- set workspace id
                      apex_application_install.set_workspace_id (n_workspace_id);   
                      -- set security group
                      apex_util.set_security_group_id (p_security_group_id => apex_application_install.get_workspace_id);
                      -- set pasring schema
                      apex_application_install.set_schema(p_schema => v_parsing_schema);
                      -- delete existing app
                      begin
                        wwv_flow_api.remove_flow(n_existing_app);
                      exception
                      when NO_DATA_FOUND then -- do nothing when the application does not exist
                        null;
                      end; 
                      -- set new app id
                      apex_application_install.set_application_id(p_application_id => n_new_app);
                      -- generate offset
                      apex_application_install.generate_offset;
                      -- set application alias
                      apex_application_install.set_application_alias(p_application_alias => v_app_alias);
                      exception
                      when others then        
                        n_err_num := SQLCODE;
                        v_err_msg := SUBSTR(SQLERRM, 1, 200);
                        dbms_output.put_line('Error number = ' || n_err_num);     
                        dbms_output.put_line('Error message = ' || v_err_msg);
                    end;
    @newapp.sql
    commit;

  • How to extract the mouse cursor image without using JNI

    I want to get the image of the mouse cursor of the system using java. The Robot class captures the screen only, but the mouse icon image is not the part of the screen, so it is not easily detected. But we can get the mouse cursor position using API, but how to get the exact image icon, without using JNI. I don't want to generate my own cursor at that position.

    I am building a Remote Desktop kinda app using java..... I want the screen of the remote comp to be viewed on my screen and generate events from my machine to the remote machine. So, I am capturing the screen images of the remote machine. But the cursor is not part of the screen object. i want to extract the cursor image icon from the remote machine to my machine and render the image.

  • How can I delete songs from iTunes but keep them on my phone?

    I want to delete songs off of my computr because it's taking up unnecessary space, but how can I do this without them being removed from my iPhone when I sync it next?

    Foxolini wrote:
    I want to delete songs off of my computr because it's taking up unnecessary space, but how can I do this without them being removed from my iPhone when I sync it next?
    As given, removing from the library causes the songs to be removed during sync. So the space taken up is neccessary... What would you do if your iPhone where lost, stolen, damaged or needed to be restored?
    If you ned more room for storage buy a bigger drive. In fact buy two, one to use as a backup for your library and all your other important files.
    tt2

  • How to make a time based image transition using CSS?

    Hi
    I want to make an image in a DIV morph into another (in the
    same DIV) and then back again every ten or 20 seconds, but I want
    the transition to be smooth. . I was wondering if there is a simple
    CSS way of doing this, rather than making an animated gif with
    stacks of frames?
    Cheers
    Shaun

    CSS doesn't do such things.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "celebritymusic" <[email protected]> wrote
    in message
    news:esm5vt$8mn$[email protected]..
    > Hi
    >
    > I want to make an image in a DIV morph into another (in
    the same DIV). I
    > was wondering if there is a simple CSS way of doing
    this, rather than
    > making an animated gif?
    >
    > Cheers
    >
    > Shaun

  • How to read the contents of images folder using AS3

    Hi,
    I'd like to load the images in the folder dynamically without using XML.
    Is there a mechanism in AS3 that enables me to read directly the content of images folder directly without using XML or should I use php to do that?
    Thanks

    Yes you can do that without XML. You need to use the Loader() class to dynamically load the images. Check the documentation of the loader class.

  • I have lost images but have them in a dvd slideshow. Is there anyway I can use the dvd to restore the individual images?

    I have lost images from a slideshow I made.  Is thre anyway I can use the dvd project to restore those lost individual images?

    If these are actually part of a QuickTime movie then the best you can do is try get screen grabs of them.
    Regards
    TD

  • How to preventing files from downloading when I open them

    Hi there,
    Is there a setting somewhere on my computer that will allow me to open files (in emails, on webpages, etc.) without first having to download them? Please help....

    No.
    If you are using an email client such as the Mail.app to access an email account, a message attachment must be downloaded with the message in order to open it and the same when accessing the account via webmail access using a browser.
    Why is this a problem?

  • How to create custom structure in smart forms & use them in interface

    hi experts....
    can anyone tell me how to use  custom structure in
    form interface (parameters) without creating any structure
    in the dictionary.

    Hi Shrama,
    If you want to use the structure in interface. You have to create structure in dictionary.
    if you create in form or in report ..they won't recongnize the local structures.
    Thanks,
    Sunil

Maybe you are looking for

  • Problem with HTML viewer

    Dear All , I am facing a problem with HTML Viewer . My senario is as follows : 1. I have created one HTML page . On that page there are 4 Images 2. I imported that HTML page in SAP with the help of transaction SMW0 3. I Called that HTML page in my AB

  • Attachments imbedding in emails when recieved in Entourage

    Why, when I send attachments of images or single page pdf's in Mail does it automatically open these files and imbe them in the email and stop them being an attachment (especially when sent to an email address opened in Entourage)?  I have tried righ

  • Selected Value for CFSelect and other options too

    I have an update form with an "Office" field. For a record, I query the db and get all the data for the record including the current office. However, since this is an update/edit form, I want the current office to display as selected, but want to als

  • Ibook monitor hook-up

    Many people here seem to need help using an external screen with their ibook, I however need help the other way around! Is it possible to use my ibook G4's 1024x768 screen as a monitor for a computer that's currently monitor-less?

  • Weblogic server is not getting started.

    Hi We are getting problem in starting weblogic server 10.2 . We have two machine they switch each other by cluster. On one machine , Weblogic server does not start when cluster switch to this machine. When server starts , it hangs. We get following e