Why not set up an alias for each domain? That way it wouldn't matter if they
were sub domains at all. Hence:
<VirtualHost *:80>
DocumentRoot /var/www/sites/site1
ServerName www.domain.co.nz
Alias /js/base /var/www/base/js
...
</VirtualHost>
On 14/12/2009, at 11:38 PM, Cristian wrote:
> The structure of the site is as follows:
>
> base
> js
> sites
> site1
> site2
>
> The subdomain site1.domain.co.nz points to directory '/sites/site1' on the
> file system. From each subdomain I need to load the global javascript file
> that lives in '/base/js'
>
> Todd's idea of creating a "global" symbolic link sounds like it might solve
> the issue.
>
> 2009/12/14 Aaron Fulton <[email protected]>
> Another angle to look at is setting the document.domain property on your
> pages. I think from memory that if you set the document.domain property of
> pages loaded on the subdomain to the url of the root domain then ajax calls
> to the root domain from a subdomains will work without causing cross domain
> errors. This is a useful trick when dealing with javascript between iframes
> (when one frame is on a subdomain)
>
> see:
> http://en.allexperts.com/q/Javascript-1520/cross-browser-access-denied.htm
>
>
> Aaron
>
> Chris wrote:
>> Hi all,
>>
>> I have a website with a number of subdomains that are all hosted on
>> the same server.
>> On the root domain I have a javascript file that is used by all the
>> subdomains and I like to keep the JS file on the root domain rather
>> than coping it to every subdomain.
>> How can a subdomain load the javascript file using a relative path to
>> avoid doing Ajax calls on a cross domain?
>>
>> Is it possible to do an Internal Rewrite for a short url in Apache
>> htaccess file
>> RewriteRule ^base/(.+)?$ /path_to_root/$1 [L]
>>
>> Any ideas?
>>
>> Thank you for your help in advance
>>
>>
>>
>>
>>
>> No virus found in this incoming message.
>> Checked by AVG -
>> www.avg.com
>>
>> Version: 9.0.716 / Virus Database: 270.14.105/2561 - Release Date: 12/13/09
>> 08:39:00
>>
>>
>>
>
> --
> NZ PHP Users Group: http://groups.google.com/group/nzphpug
> To post, send email to [email protected]
> To unsubscribe, send email to
> [email protected]
>
>
> --
> NZ PHP Users Group: http://groups.google.com/group/nzphpug
> To post, send email to [email protected]
> To unsubscribe, send email to
> [email protected]
--
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]