Including a whole website

Hey
First post on this board, as I found a bit of a problem with php, hope you guys can help :slight_smile:

If I have this script made where it creates sites and placing them in a folder like /site1/ /site2/ and so on, on a server. How can I then include that whole /site/ on a new domain, different server? With the whole /site/ on the new domain with working htaccess from that folder?

The reason is so that I can have all my sites placed on the same spot, and just a single php page to include on my other sites and servers? Is that even possible?

Thanks in advance…

if you have the files for site1 on your local box already skip step 1.

  1. download all files in the directory for site1 to your local box.

  2. upload to new server. Files should go in the web root. Verify permissions!

with working htaccess from that folder?

I don’t know what that means, please explain.

No I dont want to move the files.

I want them to be able to run from another server.

Like this

www.domain.com/site1/

then on www.anotherdomain.com I put a index file, with a bit of php code that include the whole www.domain.com/site1/ which is a working website

try building a single HTML page with an iframe. In the src add the address of the other site???

I don’t understand your purpose…

Iframe wont work for this.

I want to be able to build sites with a script I have made, but without to having moving all the files/templates around all the time, from server to server. Just small php files for including the websites.

I got nothing…

eh, it sounds like he’s trying to hotlink pages, something like embeding youtube videos on your site. The video itself is actually stored on youtube’s servers, but you’re viewing it from your site. I can’t really see a good reason to do an entire site like that, unless its for some kind of backup utility.

Its for having one server to host the whole network of sites, and then have small hosting accounts to display the pages. But guess you guys dont have the solution?

It can be done, its just impracticle to do it like that. have a look at using get_file_contents() - i think that’s the function, or curl (if both hosts have it enabled). basically, with the first one, you’re reading the file contents into a variable, with the proper html encoding, you should be able to recreate the page.

I cant be done that way. As the htaccess file placed in the /site1/ wont work on the domain where I include it.

Sponsor our Newsletter | Privacy Policy | Terms of Service