Results 1 to 4 of 4

Thread: 2 websites, same content

  1. #1
    Confused...
    Join Date
    Jul 2003
    Location
    3.2 GHz
    Posts
    396
    Thanks
    0
    Thanked
    0 times in 0 posts
    • hotpurple's system
      • Motherboard:
      • Asus P5Q Pro
      • CPU:
      • Core 2 Quad Q6600
      • Memory:
      • 8Gb Corsair XMS PC6400
      • Storage:
      • 640 GB Samsung Spinpoint F1
      • Graphics card(s):
      • HD 4850 Passive
      • PSU:
      • 580W Hiper
      • Case:
      • Antec P180
      • Operating System:
      • Windows 7 X64
      • Monitor(s):
      • Samsung 223BW
      • Internet:
      • What's the internet?

    2 websites, same content

    Hi,

    I'm quite new to apache, but I administrate an application that uses apache to create a web based UI.

    Internally the website uses the server's fully qualified machine name eg hostname1.domain1.com/webapp

    I'm trying to set the application to be accessable by anyone with an internet connection, external to the company, that is move the app from the local intranet to be accessable from the internet, but still allow the old intranet address to be accessible internally.

    As a result I need to be able to rewrite all the links the application produces, which are created dynamically (so I am lead to believe). I believe I need to use a combination of mod_rewrite and virtual hosts, I'm just not sure how to set this up.

    What I want to do is setup a server that answers to both:

    http://hostname1.domain1.com/webapp
    and
    http://hostname1.domain2.co.uk/webapp

    and for all the urls to be rewitten on the fly to link to the domain2.co.uk address.

    Can anyone suggest how I do this please?

    Many Thanks

    Chris
    I own a PC that changes regularly, so I don't bother putting anything in here...

  2. #2
    Treasure Hunter extraordinaire herulach's Avatar
    Join Date
    Apr 2005
    Location
    Bolton
    Posts
    5,618
    Thanks
    18
    Thanked
    172 times in 159 posts
    • herulach's system
      • Motherboard:
      • MSI Z97 MPower
      • CPU:
      • i7 4790K
      • Memory:
      • 8GB Vengeance LP
      • Storage:
      • 1TB WD Blue + 250GB 840 EVo
      • Graphics card(s):
      • 2* Palit GTX 970 Jetstream
      • PSU:
      • EVGA Supernova G2 850W
      • Case:
      • CM HAF Stacker 935, 2*360 Rad WC Loop w/EK blocks.
      • Operating System:
      • Windows 8.1
      • Monitor(s):
      • Crossover 290HD & LG L1980Q
      • Internet:
      • 120mb Virgin Media
    Itd be much easier to rewrite it to use relative rather than absolute paths (i.e ../blah) to go one directory up and into the folder blah than rewrite the entire thing based on the incoming ip (which would prob be the easiest test for internal or external)

  3. #3
    Confused...
    Join Date
    Jul 2003
    Location
    3.2 GHz
    Posts
    396
    Thanks
    0
    Thanked
    0 times in 0 posts
    • hotpurple's system
      • Motherboard:
      • Asus P5Q Pro
      • CPU:
      • Core 2 Quad Q6600
      • Memory:
      • 8Gb Corsair XMS PC6400
      • Storage:
      • 640 GB Samsung Spinpoint F1
      • Graphics card(s):
      • HD 4850 Passive
      • PSU:
      • 580W Hiper
      • Case:
      • Antec P180
      • Operating System:
      • Windows 7 X64
      • Monitor(s):
      • Samsung 223BW
      • Internet:
      • What's the internet?
    Thanks for the speedy reply,

    Unfortunately I can't do that, as the web based application creates it's links dynamically, based on some processes that run in the background (it's a data management solution that uses a web page as it's ui). The domain was specified during the installation of the system and I am now unable to change it without delving deep into the code that runs the system, which I am loath to do. Is there not a way to use mod_rewrite to just change the URL?

    Cheers

    Chris
    I own a PC that changes regularly, so I don't bother putting anything in here...

  4. #4
    Ah, Mrs. Peel! mike_w's Avatar
    Join Date
    Oct 2003
    Location
    Hertfordshire, England
    Posts
    3,326
    Thanks
    3
    Thanked
    9 times in 7 posts
    Perhaps you could just open another port for Apache, tell it to go to the same place as the existing site (or a symlink to it), and do some DNS voodoo to get external hits to go to the new port?

    For mod_rewrite, I'm not sure it can change the actual domain name, but I could be wrong. These are as good as any places to start:

    http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html
    http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html

    Edit: Ooo, this looks interesting (from the 2.0 doc):

    ^/somepath(.*) http://otherhost/otherpath$1 http://otherhost/otherpath/pathinfo via external redirection
    Last edited by mike_w; 19-03-2006 at 02:43 PM.
    "Well, there was your Uncle Tiberius who died wrapped in cabbage leaves but we assumed that was a freak accident."

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Websites for viewing on PDAs...
    By headbrace in forum Smartphones and Tablets
    Replies: 4
    Last Post: 19-04-2006, 07:17 PM
  2. Replies: 3
    Last Post: 06-03-2006, 10:42 PM
  3. Replies: 3
    Last Post: 20-01-2006, 02:44 PM
  4. Replies: 0
    Last Post: 22-09-2005, 09:46 AM
  5. Content Management Systems?
    By Nick F in forum Networking and Broadband
    Replies: 3
    Last Post: 14-05-2005, 12:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •