To protect files from being served directly, either configure them to be
resouce files:

http://code.google.com/appengine/docs/java/config/appconfig.html#Static_Files_and_Resource_Files

Or store them within the WEB-INF directory. For example, the default BD
configuration defines the "WEB-INF/customtags" directory as being on the
custom tags path; these custom tag files can't be served directly because
nothing within WEB-INF can be served directly. You could do the same with
any other files (for example, you can do <cfinclude
template="/WEB-INF/myinclude.cfm"/>).

If GAE allows you to map multiple domains to a single application (I don't
know if it does), then it would be very easy to write code within your app
to forward to a different folder based on the HTTP header (CGI.SERVER_NAME).
See the BD docs for the CFFORWARD tag or you can use
getPageContext().forward(). Something like this:

  <cfif cgi.server_name eq "www.abc.com">
      <cfforward page="/abc#cgi.script_name">
  <cfelseif cgi.server_name eq "www.xyz.com">
      <cfforward page="/xyz#cgi.script_name">
  <cfelseif ... >
      ...
  </cfif>

If you wanted to get really fancy, you could configure the
servername-to-folder mapping in an XML file or a struct and then just do a
lookup (instead of hardcoding as above).

Note that a "forward" is a server-side redirect that does not require a
round-trip to the client, nor does it modify the URL within the browser the
way a client-side redirect (CFLOCATION) does.

Vince

On Thu, Jun 4, 2009 at 1:23 PM, Baz <[email protected]> wrote:

> I have always been uncomfortable exposing files to the web that don't need
> exposing, like my cfc's, the administrator, assets (such as download files
> which I would pull with a download.cfm page). Usually I have a /www folder
> that only contains cfm, css and image files. How would one protect files
> from direct linking?
>
> Also, there's a limit of 10 apps, and I have 50+ tiny,  business-card-style
> websites that don't need an entire instance.
>
> Baz
>
>
>
>
>
> On Thu, Jun 4, 2009 at 10:16 AM, Vince Bonfanti <[email protected]>wrote:
>
>> Not that I'm aware of, but why would you need to? Just create another GAE
>> application.
>>
>>  On Thu, Jun 4, 2009 at 1:13 PM, Baz <[email protected]> wrote:
>>
>>> Is it possible to change the web root on GAE. Or have multiple domains
>>> resolve to different folders?
>>>
>>>
>>>
>>
>>
>>
>>
>
>  >
>

--~--~---------~--~----~------------~-------~--~----~
Open BlueDragon Public Mailing List
 http://groups.google.com/group/openbd?hl=en
 official site @ http://www.openbluedragon.org/

!! save a network - trim replies before posting !!
-~----------~----~----~----~------~----~------~--~---

Reply via email to