使用mod_rewrite进行代理重写URL时出现ERROR 404 - PAGE NOT FOUND

时间:2013-12-25 17:57:44

标签: php apache .htaccess mod-rewrite proxy

此指令会将 example.com 重定向到 example.info/es/test.php

RewriteRule ^$ http://example.info/es/test.php [R]

此指令将 example.com 错误404 - PAGE NOT FOUND 而不是将其重写为 example.info/es/test.php

RewriteRule ^$ http://example.info/es/test.php [P]

网络主机是 HostGator ,他们说mod_proxymod_proxy_http已启用。我认为,使用mod_rewrite进行代理不适用于他们的服务器..

错误日志:

[Wed Dec 25 10:45:05 2013] [alert] [client 112.210.128.107] /home2/USER/public_html/example.com/.htaccess: LoadModule not allowed here 
[Wed Dec 25 10:45:11 2013] [alert] [client 112.210.128.107] /home2/USER/public_html/example.com/.htaccess: LoadModule not allowed here 
[Wed Dec 25 10:47:39 2013] [error] [client 181.160.101.118] File does not exist: /home2/USER/public_html/example.com/es 
[Wed Dec 25 10:47:49 2013] [error] [client 112.210.128.107] File does not exist: /home2/USER/public_html/example.com/es 

我会尝试很多测试,但我不知道错误的确切行(但我认为这是最后两行) ..

0 个答案:

没有答案