WebFaction
Community site: login faq

Hello.

I need to move a python application (mod_wsgi 3.3/Python 2.7) to subfolder on a specific domine for testing proposes. Eg.: www.site.com will be www.site.com/test When I did this, all styles, images and media are not shown as it is pointing to the root location (www.site.com/).

My image are coded like this: "src="/img/footer.jpg"" For www.site.com it is work well, but in case of www.site.com/test I should add "/test" to all my images source paths.

May by I do not understand well something, but in case of a simple html it should work well, as the path is relative.

So my question is, what should I add to my application variables, or what to change?

Thank You in advance. Best regards.

asked 18 Jan '12, 09:18

Andreikod
11
accept rate: 0%


We always recommend that you serve static media from a separate static-only app (or from a static-only symlink app). For example, if your images are in /home/username/webapps/myapp/img:

  1. In the control panel, create a new 'symbolic link to static-only' app, using "/home/username/webapps/myapp/img" as the path in the extra info field.
  2. In the control panel, add the new app to your site, using "/img" as the URL path.

In this configuration, your images will be served directly from our front-end Nginx server, which means your back-end Apache will serve your application faster while using less memory.

Hope that helps!

permanent link

answered 18 Jan '12, 12:22

seanf
12.2k41836
accept rate: 37%

1

Ok, I will try to solve this issue in this way.

Thank You seanf! BR.

(18 Jan '12, 14:42) Andreikod
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:

×337
×19

question asked: 18 Jan '12, 09:18

question was seen: 2,473 times

last updated: 18 Jan '12, 14:42

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