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.

Two servers. example.net, and example.com

On http://example.net, My httpd.conf contains

# example.net
RewriteEngine On
RewriteRule  ^/felipetest2 http://example.com/webpage [P]

I am getting a 302 Moved, which is pointing to http://example.net/webpage, but should be http://example.com/webpage

What's going on?

I have control over both .net and .com servers in these examples.

I know I can do the same with ProxyPass and ProxyPassReverse, but I'm trying to get my head around this one.

Edit: Main Question: How do I show a maintenance page, without changing URL in the browser? On same domain, or across different domains?

share|improve this question
1  
Is there any RewriteRule for example.com? Append a [L] flag to see what happens. –  quanta Nov 14 '11 at 7:04
    
This is the only Rule –  Felipe Alvarez Nov 16 '11 at 0:12

1 Answer 1

You should use the flag [R] instead of [P] at the end of your RewriteRule if you would like that the redirection is performed externally by the browser.

share|improve this answer
    
Suppose I didn't want the visitor to 'notice' a change to the URL (i.e. the URL does not change) and no HTTP redirect is given.... –  Felipe Alvarez Nov 14 '11 at 9:43
1  
@FelipeAlvarez if you want to do this you can only do this on the same domain, otherwise, even though you don't precise the [R] directive, Apache will generate a redirection. –  Olivier Pons Nov 14 '11 at 17:56
    
This can only be done on the same domain? But ProxyPass can do this over more than one domain (I am using it myself, now). Why is RewriteRule ...[P] not able to do what proxypass can do? I thought that was the purpose of [P] –  Felipe Alvarez Nov 16 '11 at 0:13

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.