.htaccess using proxy server [P]

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

Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} =one.com RewriteRule ^(.*)$ http://two.com/$1 [P] 
+6
url-rewriting .htaccess mod-rewrite apache2
source share
1 answer

If mod_proxy was compiled as a general module, it requires that you also explicitly load the corresponding submodules. It is possible that mod_proxy_http not enabled on your server, which leads to an internal server error when mod_proxy tries to process the request passed to it by mod_rewrite .

mod_proxy itself is turned on, as you said, and probably works, because if you don’t have it, using the P flag will generate a 404 response. It's hard to know for sure, although without an error log, so you need to find someone with access to it to find out what is happening to help you solve the problem.

+8
source share

All Articles