subdomain serves files and images on main domain

Using a single web hosting account to host multiple sites

subdomain serves files and images on main domain

Postby MIKEYD03 » Mon May 28, 2007 1:49 pm

I want a subdomain to be able to serve files from my main domain. Say I have a page http://sub1.mydomain.com/index.html
I want to link to a pdf file at http://www.mydomain.com/file.pdf

Site have different file locations:

mydomain.com - /www/mydomain/httpdocs/

sub1.mydomain.com - /www/subdomains/sub1/httpdocs/

What I'm trying to do, is update the PDF files on my main domain, and have the subdomain be able to serve the files, so no need for duplicate file in each domain.

Can anyone help?
TIA
MIKEYD03
 
Posts: 3
Joined: Mon May 28, 2007 1:01 pm

Postby richardk » Tue May 29, 2007 11:19 am

I want a subdomain to be able to serve files from my main domain. Say I have a page sub1.mydomain.com/index.html
I want to link to a pdf file at mydomain.com/file.pdf

What's wrong with a normal link (<a href="">) to the file on the main domain?

Site have different file locations:

mydomain.com - /www/mydomain/httpdocs/

sub1.mydomain.com - /www/subdomains/sub1/httpdocs/

Mod_rewrite can't rewrite to a location above the document root (eg. from /www/mydomain/httpdocs to /www/subdomains/sub1/httpdocs). If you really want to do it, you will need to ask your host if they can set it up (they may be able to create a SymLink or an Alias).
richardk
 
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 4 guests

cron