share files for different subdomains

Using a single web hosting account to host multiple sites

share files for different subdomains

Postby trash-box » Sun Aug 31, 2008 6:49 am

Code: Select all
/home/    DOCUMENT_ROOT for
/home/  DOCUMENT_ROOT for

I want to share some javascript, CSS and image files inside the www-folder. i've done this with a .htaccess in /home/

Code: Select all
RedirectMatch ^/(pix|js|css)/(.*)$1/$2 [L]

this works perfect for CSS and images. And also for most javascripts. But some javascript-code has to be loaded from the same host as the html-file to work correct (e.g. for AJAX functionality).

how can i change this to load the javascript files from /home/ but deliver them through

my idea is not to upload javascripts twice. an other possibility is to create a symbolic link from /home/ to /home/ but im not able to create symbolic links...

i hope it is clear what i mean.
Posts: 1
Joined: Sun Aug 31, 2008 6:33 am

Postby richardk » Sun Aug 31, 2008 8:46 am

Do you have access to the <VirtualHost> to use an Alias?

You can't rewrite outside the document root so you would have to use mod_proxy with mod_rewrite
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^js(/.*)?$$0 [P,L]
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 2 guests