6

I am trying to do an invisible (transparent ?) rewrite via .htaccess and the proxy flag. It works with the [R] flag but not with the [P] flag because it just gives a 500 error. The two domains are on separate servers and the mod_proxy module is enabled. Is my .htaccess correct?

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST}    =one.com
RewriteRule ^(.*)$          http://two.com/$1 [P]
4
  • Can you check the error log on the server that you're getting the 500 error on to see what the specific error was?
    – Tim Stone
    Commented Sep 14, 2010 at 17:11
  • This is the error I get : .IP..*** - - [14/Sep/2010:19:33:11 +0200] "GET /149c9fad24f457143dcb HTTP/1.1" 500 433 "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; fr-fr) AppleWebKit/533.18.1 (KHTML, like Gecko) Version/5.0.2 Safari/533.18.5"
    – Sinklar
    Commented Sep 14, 2010 at 17:34
  • That's from the access log though, there should be a separate error log that explains why Apache generated a 500 response.
    – Tim Stone
    Commented Sep 14, 2010 at 21:07
  • Nope sorry, I don't have access to any other log...
    – Sinklar
    Commented Sep 17, 2010 at 11:42

1 Answer 1

8

If mod_proxy was compiled as a shared module, it requires that you explicitly load the relevant submodules too. It's possible that on your server mod_proxy_http is not enabled, which leads to an internal server error when mod_proxy tries to handle the request passed to it by mod_rewrite.

mod_proxy itself is enabled and probably working like you said, since if you don't have it enabled, use of the P flag will just generate a 404 response. It's hard to know for sure though without the error log, so you may need to find someone with access to it to see what's going on to help you resolve the problem.

1
  • 2
    thanks for the note about the 404 -- I couldn't figure out why I was getting it! Commented Jun 15, 2013 at 18:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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