Hi, I have a site directory site.com and an alpha directory, alpha.site.com. What do I need to do to enable alpha.site.com access to files in the directory for site.com? Thanks!
Assuming alpha.site.com is where you are building the next version of the site and you just require it to be able to access the data files from site.com then in PHP you can either use something like include '../site.com/something.php'; or you can use an absolute path e.g. include '/home/youraccount/site.com/something.php'; I've used PHP as an example because that's what I use but the principle should be the same for other languages.
Thanks. To be more precise: I want to access images and txt files on the site dir from the alpha dir. '/home/youraccount/site.com/something.png' and '/home/youraccount/site.com/something.txt' from '/home/youraccount/subdomains/alpha/site.com/something.php' Thing is, I cant... alpha doesnt get access to site per above currently...
If you're using apache and have mod_proxy installed then give the following a go, it needs to be in .htaccess for alpha.site.com: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*) http://atlantichosting.net/$1 [P] Code (markup): If you don't have mod_proxy then try the following instead: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*) http://atlantichosting.net/$1 [R=302] Code (markup): In the 1st version if the file doesn't exist then the file is fetched from the site.com domain and returned to the browser as though it came from your alpha.site.com domain. In the 2nd version if the file doesn't exist then the browser is redirected to the file on the site.com domain and the data comes from site.com. Let me know how you get on.
Odd the [P] version should show the files as coming from the alpha domain, however does the redirecting work for your requirements?
Unfortunately not, it currently immediately redirects me from alpha.site.com to site.com (in the browser).
Does it redirect no matter if the file exists or not and you take the lines I gave you out of the alpha .htaccess does it still redirect?
Do you have anything else in the .htaccess file apart from the 3 lines from: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*) http://atlantichosting.net/$1 [P] Code (markup):
I did. Had a closer look and there was some interference going on. Your suggestion works brilliantly now. Thanks!
Oops too quick Im afraid. What it does now is to stay on the alpha URL but actually picks up the scripts from the live dir, even though they exists on alpha..
Sorry for the delay I got caught up with other things, give the following a go it should solve the issue of the home page: RewriteEngine on RewriteCond %{THE_REQUEST} !^[A-Z]+\ /\ HTTP/ RewriteCond %{REQUEST_URI} !-f RewriteRule ^(.*) http://atlantichosting.net/$1 [P] Code (markup): For anything else I'll need to see both sites so that I can understand what you have.
Thanks. It did. I still cant pull files from the live directory though. Strange. I also tried with symbolic links without any luck. With have a look later on. Cheers
Not sure what you mean by that, you can't get them via the alpha domain or do you mean via scripting? Do you an example of what you are trying to do that isn't working?