Share files (eg. swf) across multiple sites using web.config - apache-flex

I'm managing a flash/flex system which is shared across multiple sites on the same server.
Rather than having to store the duplicates of the same swf files on each site I would like to setup a folder on the server (windows 2008 iis7) containing these swfs and allow each site to use the same swf files. I would like to include these files somehow so the user thinks the swf files are coming from the source domain not the a shared domain.
I'm used to using coldfusion mapping to share files but this isn't available for non-coldfusion files i.e. swf
I wondered would it be possible to rewrite urls in my web.config file to these swf files?
Please could someone suggest a way to do this?
Thanks
David

Can you do a "virtual directory" in your web server?
IIS: http://support.microsoft.com/kb/172138
Apache: http://w3shaman.com/article/creating-virtual-directory-apache
It's much like a CF mapping does for CF, but this on the web server level, making the mapped resources accessible via URL.

If you're talking about setting up your own CDN (content delivery network), then just setup another website simply to serve up all your graphics, scripts, CSS, swfs etc.

Related

Is it possible to host a asp.net web-application in folder and drive different from C:\Inetpub\wwwroot?

I have a problem.
I have less than 5GB available,
now I have to host a web application on it, I need at least 20GB space for it,
it is not possible to increase the space on C drive without formatting it.
So is it possible to host the web app from any other drive?
What are you hosting your application with?
If it's with your own IIS then yes, you can just change the directory of the website.
In IIS right click the site, go to Manage Web Site -> Advanced Settings.
Change the Physical location to your site on a different drive.
If I understand the question correctly ..... Yes the files for your web application can be on a different drive (and often are) you just need to configure IIS to look at the correct path and set the correct security on the folder

Same virtual (global) directory for multiple websites

I am working on multiple websites in asp.net mvc. Some websites are top level domains and some are subdomain but all these websites are hosted on same server.
www.foo.com
subfoo.foo.com
www.abc.com
a.abc.com
I want all these websites should access same directory for save and retrieve some files in this way i can manage files efficiently.
www.foo.com/assets
subfoo.foo.com/assets
Currently every website is handling data its own wwwroot directory so when i need these files on different website then i have to do lot of work for retrieval.
For this purpose i have created folder out side the websites directory and point out as virtual directory in one websites. I tried to repeat same process for other websites but can 't do this because hosting server does not permit me to point out virtual directory on same folder.
So my question is this limitation of IIS. Is there any other technique to do this task in better way?
Virtual directory is the only way I know of to do what you ask. It sounds odd that you have a limitation of one virtual directory pointing to the same folder, maybe you need a new host.
EDIT: Just realized how old this question was. Well maybe this will still be of help to someone.....
We run IIS with Approx 5 different web sites. These websites each have their own root directory. We don't typically access things from the other websites, but if we were to do this I would think we would setup another directory on the server for those files to live in. This is assuming that the files you are trying to access are static files.
To Clarify...
C:\inetpub\WebSite1Root
C:\inetpub\WebSite2Root
C:\inetpub\WebSite3Root
Then place the static files in
C:\StaticFiles
So to access those static files Website1 (or 2 or 3) would simply look in that shared directory.
I'm not sure if this helps but I would be happy to answer questions if you have any.

Serving ASPX pages from outside the web root

Currently working on an internationalization project. One of the requirements is to take static files published from a content management system and serve the correct language version based on the locale. Unfortunately the published files are .aspx and include references to master pages and potentially other controls.
If the pages are inside the web root, this is pretty easy. I just have something in global Application_BeginRequest that takes a request for /abc.aspx and rewrites it to /content/[locale]/abc.aspx.
For ease of deployment and a couple of other reasons, I would really like these files to be outside the web root. e.g. site is in "D:\www_root\site\" and content is in "D:\content".
Is there a way to achieve this?
You can create a virtual directory in IIS that points to d:\content.
A virtual directory is a directory name (also referred to as path) that you specify in IIS and map to a physical directory on a local or remote server. The directory name then becomes part of the application's URL, and users can request the URL from a browser to access content in the physical directory, such as a Web page or a list of additional directories and files.

How to download a file from a single folder when application hosted on multiple servers

I have asp.net application which is going to be deployed on multiple servers (web garden).
One of my server has ReadyToExport folder, where all the file get placed from a different service. When user click on download link i wanted to route that to this single folder(ReadyToExport). How do i route all the download request to a single folder. Please suggest a way to solve this problem.
Share a folder between multiple servers and keep the files there?

Protect folder from external requests

Im working with asp.net 2.0, and i have a folder into my application path ~/Data/ with some .mdb files.
I would like to protect this folder from external request like http://www.whatever.com/Data/whatever.mdb
But i would need to give any permission to my application, cause im using OleDBConnections agains the ~/Data/ Path.
What could be the best way to protect this folder?
Kind Regards.
Josema.
In IIS manager and remove at least anonymous access if not all access. Your application code can continue to use its contents but HTTP requests can not access it.
If possible in your situation, another option would be to place the mdb files outside of the website. For example, something like this directory structure:
/ MyProject
/ Data
- whatever.mdb
/ www
- Default.aspx
where www is the actual root of your website. That way, users will never be able to access the mdb files from the browser, while you can still use OleDBConnections against the mdb files. To my knowledge this is pretty secure, and this way you can't accidentily forget to disallow access in IIS.
Did you check if it actually is a problem?
I'm using ASP.NET 3.5 here but the default App_Data folder is shielded for downloading. Maybe you should just follow the guidelines and verify.
As for the other answers about moving Data outside your Web folder, that usually won't work when you use a hosting provider.

Resources