Forum Moderators: coopster & phranque

Message Too Old, No Replies

Mass Automation of Multiple Domains

         

Shawn Steele

1:53 am on Jan 23, 2004 (gmt 0)

10+ Year Member



Im looking for a script of some sort that would automate websites on multiple domains with the same content but change the variable of that site (eg, city name, state name, name of widget etc). How can I do this? I have given up and accepted that it might be easier to just load all the pages onto a main server and have the widgetname websites pull from that, so that the only changes would always be on the main server.

I have tried one small script helped me out which was made to pull the content on www.widgetname.com from www.my-main-domain.com/widgetname and it worked great for the index page of www.widgetname.com, but if I go to any other pages on www.widgetname.com, its pulled from www.widgetname.com, so what can I do to make the sub pages also pull from www.my-main-domain.com/widgetname?

----code sample---
<?php
$url = "http://www.my-main-domain.com/widgetname";
if ($fp = fopen($url, "r")) {
while ($buf = fread($fp, 8192))
print $buf;
fclose($fp);
} else {
print("Cannot retrieve $url\n");
}
?>

Please help. Thanks

SeanW

4:35 pm on Jan 23, 2004 (gmt 0)

10+ Year Member



If you're generating static content with a few variables changed, I'd look into HTML::Template or Template-Toolkit...

Sean

Shawn Steele

7:12 pm on Jan 23, 2004 (gmt 0)

10+ Year Member



Hi,

I looked for something like that, but didnt undertstand it. What if I did a switch statement in php to pull a x subfolder if they go to x domain, is that possible?

Thanks,
Shawn

SeanW

7:24 pm on Jan 23, 2004 (gmt 0)

10+ Year Member



Oh... are you wanting

[blue-widgets.com...]
to redirect to
[mywidgets.com...]

?

If so, I think you want to look at Apache's mod_rewrite, and either a simple transformation (where all domains are the same form) or a RewriteMap

I suppose it could be done in PHP with a case statement, as you say, though it seems like an expensive way to to it.

Sean

Shawn Steele

7:44 pm on Jan 23, 2004 (gmt 0)

10+ Year Member



Yes, but not redirect, rather just read from [mywidgets.com...] (or any file) and display the results on [blue-widgets.com...]

does this make sense? Basically, I just want an easy way to make modifications to 200+ domains (exact sites, just different state names, example, Alabama Widgets) without having to ftp into every site, so I thought the best way would be to load all the fresh content on one server with 200+ sub directories and and have the individual domains read from the respective subdirectories on the main server, but actually have real links on that server, eg: [blue-widgets.com...] index3.htm etc. or is there a better way of doing this?