LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 11-25-2008, 09:08 PM   #1
MisterFine
LQ Newbie
 
Registered: Nov 2008
Posts: 0

Rep: Reputation: 0
Question How do I get Apache Rewrite to proxy two domains ?


I am trying to set up an Apache conf file that will allow me to reverse proxy two (or more) different domains. Here's what I have:

In my example below, I am trying to proxy inbound requests as follows:
requests for www.abc.com are proxied to www.abcdest.com
requests for www.def.com are proxied to www.defdest.com

<VirtualHost *>
ServerName www.abc.com
RewriteEngine on
RewriteRule ^(.*) http://www.abcdest.com$1 [P]
</VirtualHost>

<VirtualHost *>
ServerName www.def.com
RewriteEngine on
RewriteRule ^(.*) http://www.defdest.com$1 [P]
</VirtualHost>

www.abc.com correctly proxies www.abcdest.com.
However, when I go to www.def.com, I get www.abcdest.com!

I've been trying to figure this out for a couple of days...

Any help would be greatly appreciated.

Thanks,

Russell
 
Old 11-28-2008, 06:16 AM   #2
datopdog
Member
 
Registered: Feb 2008
Location: JHB South Africa
Distribution: Centos, Kubuntu, Cross LFS, OpenSolaris
Posts: 806

Rep: Reputation: 41
Why dont u use mod_proxy instead it was designed for what u want to do
Code:
<VirtualHost *>
ServerName www.def.com
ProxyPass         /  http://www.defdest.com/
ProxyPassReverse  /  http://www.defdest.com/
</VirtualHost>
 
  


Reply

Tags
apache, proxy, reverse


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rewrite URL path in reversed proxy setup ptemmerman Linux - Software 1 11-18-2008 07:53 AM
Need to work out rewrite rules with proxy-balance mago Linux - Server 0 03-10-2008 07:56 PM
Sub Domains & Multiple Domains (Apache) lugos Linux - Server 1 09-01-2006 11:22 PM
Need help with Apache rewrite kinetik Linux - General 6 05-19-2006 07:02 AM
apache proxy server rewrite urls slackwarefan Linux - Software 0 10-19-2004 08:58 PM


All times are GMT -5. The time now is 10:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration