0 Replies Latest reply on Aug 30, 2006 5:55 PM by Newsgroup_User

    Can mod-rewrite mimic other domains?

    Level 7
      I have five websites based on a virtual private server. I would like to
      move all my scripts, includes and content to the main website,
      www.geobop.org, though still displaying articles on all five websites.
      It looks like I could do this with PHP's get_file_contents function, but
      it apparently ramps up the bandwidth usage considerably. So I'd now like
      to know if this could be done with Apache's mod-rewrite function.

      Let's say I have a static page at www.geobop.org/World/index.php, and I
      can display dynamic pages at URL's like www.geobop.org/World/Arizona.
      Could I use mod-rewrite to change that to www.geozoo.org/World/Arizona?

      If so, would I still need a static page at
      www.geozoo.org/World/index.php (and my other websites), or could
      everything be handled through www.geobop.org/World/index.php? And would
      each website need a .htaccess file, or would I just use one master
      .htaccess file stored on www.geobop.org?

      This is what my mod-rewrite rule for World/index.php looks like:

      RewriteRule ^World/([a-zA-Z0-9()_/=]+)?$ World/index.php?area=$1 [L]

      How could I modify it so that it displays dynamic URL's on another
      domain, like www.geozoo.org? I envision a series of rules similar to the
      following:

      RewriteRule ^World/([a-zA-Z0-9()_/=]+)?$ World/index.php?area=$1 [L]

      RewriteRule ^ http://www.geozoo.org/World/([a-zA-Z0-9()_/=
      http://www.geozoo.org/World/index.php?area=$1 [L]

      RewriteRule ^ http://www.politix.us/World/([a-zA-Z0-9()_/=
      http://www.politix.us/World/index.php?area=$1 [L]

      Thanks!

      --
      www.geobop.org - Family Websites
      www.invisible-republic.org - Adult political websites (Mature adults only)