WebFaction
Community site: login faq

I've setup my php5.4 website at domain.com and media.domain.com (a static app with no .htaccess) contains the following tree structure :

css
fonts
images
js
photos

But none of the fonts are loading since its from a different sub-domain (media.domain.com).
I know its not possible to add Header set Access-Control-Allow-Origin "*" in media.domain.com because its a non-htaccess app. But is there a way to load custom fonts from a static-only (no .htaccess) app ?

asked 01 Jun '13, 04:44

epqrs
16931533
accept rate: 0%


It's not possible to set any custom headers on data sent from a "Static-Only (no .htaccess)" application.

That said, this shouldn't be a problem. Generally you would set the header on the page which is referencing "media.domain.com", and not from the content at "media.domain.com" itself. Specifically, if you load a page from your primary domain, "domain.com", the header there should allow media to be imported from "media.domain.com", so the fact that you cannot set this for the static media served by the static-only application should not be relevant.

A specific discussion of the methods used to satisfy Access-Control-Allow-Origin requirements is available in this related community post.

Finally, if there is a particular reason why you believe that the header needs to be coming from the static media itself -- for instance, this works if your media.domain.com is a Static/CGI/PHP application but not if it is a Static-Only (no .htaccess) application -- please update the question with more details about how and why this is the case.

Hope that helps!

permanent link

answered 01 Jun '13, 22:04

ryans ♦♦
5.0k103960
accept rate: 43%

edited 01 Jun '13, 22:06

So where should I be entering Access-Control-Allow-Origin: http://media.mydomain.com ?

(04 Jun '13, 06:23) epqrs

If you use a static/cgi/php application for your media app, you can set it in .htaccess in that app directory.

If you use a static-only application for your media app, then you cannot set it at all.

(04 Jun '13, 13:20) 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:

×75
×4

question asked: 01 Jun '13, 04:44

question was seen: 9,755 times

last updated: 04 Jun '13, 13:20

                              
WEBFACTION
REACH US
SUPPORT
LEGAL
© COPYRIGHT 2003-2021 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