WebFaction
Community site: login faq

I'm having trouble figuring out how to prevent hotlinking of static media with my current setup.

I have a main Django application and then a "symbolic link to static-only app" which simply symlinks to my static content directory in my main Django app. Now I need to prevent hotlinking to the static content.

I read that this involves modifying .htaccess but since I'm symlinking I don't have any .htaccess file in this application. So basically I guess I need to change my static app type to one which has .htaccess, e.g. "Static/CGI/PHP".

So the question is:

Is there any way to make a "Static/CGI/PHP" application with a .htaccess file simply "redirect" or "alias" anything which passes all the rewrite rules to my current static content directory in my main Django app?

asked 22 Nov '10, 14:45

Deniz Dogan
16246
accept rate: 0%


I don't think you need a separate Static/CGI/PHP application. You can use a Static/CGI/PHP symlink instead of a Static-only symlink, and then use whatever rewrites you need in the .htaccess file in your static content directory.

permanent link

answered 22 Nov '10, 16:14

seanf
12.2k41836
accept rate: 37%

Could you elaborate a bit? Do you mean the application type "Symbolic link to static/cgi/php app"?

(23 Nov '10, 10:27) Deniz Dogan

Yes - create a "Symbolic link to static/cgi/php app" app pointing to your static content directory, and then put your rewrite directives in .htaccess in that directory.

(23 Nov '10, 10:30) seanf
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×909
×125
×75

question asked: 22 Nov '10, 14:45

question was seen: 15,890 times

last updated: 23 Nov '10, 10:30

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM