Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've got a very annoying problem:

our webserver handles 2 (more actually but let's say 2 for a simpler example):

  • pretassur.fr
  • pretassuragentimmobilier.fr

Here's what I want to do: change

(whatever1).pretassuragentimmobilier.fr(/whatever2)

to

(whatever1).pretassur.fr(/whatever2)?theme=agentimmobilier

So here's my rewriterule:

RewriteCond %{SERVER_NAME} (([a-z]+\.)*)pretassuragentimmobilier.(fr|com)
RewriteRule   ^(.+)        http://%1pretassur.fr$1 [E=THEME:pretassur_agent,QSA]
# if THEME not empty, set it :
RewriteCond   %{ENV:THEME} ^(.+)$
RewriteRule (.*) $1?IDP=%{ENV:THEME} [QSA]

The big (huge) problem is: let's have a look at the rewrite logs:

[pretassurmandataireimmo.com] (5)
=> setting env variable 'THEME' to 'pretassur_mandataire'
[pretassurmandataireimmo.com]
=> (2) implicitly forcing redirect (rc=302) with http://pretassur.fr/

Aaaaaaaaarg! "implicitly forcing redirect" => I don't want that ! I want to internally redirect to pretassur.fr, not to make a real redirect!

Now if you type: http://pretassurmandataireimmo.com it is redirected to http://pretassur.fr/?IDP=pretassur_mandataire (try it) I don't want that! I want to display this page http://pretassur.fr/?IDP=pretassur_mandataire but without touching the original host!

Any idea?

Thanks a lot!

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Even if they are on the same server you cannot do internal redirects between two different vhosts. Hence the external (302) redirect.

To accomplish what you want you could use the "'proxy|P' (force proxy)" option.

share|improve this answer
    
That may be the good way to go, but I don't see technnically how to do this... I mean if I use proxy|P option, this implies using the httpd server as a proxy too? If so, what configuration should I add? Thanks again for your answer! –  Olivier Pons Dec 23 '10 at 9:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.