2011-12-02 24 views
1

我試圖建立我的htaccess的,讓我去domain.com/file.html並將其加載otherdomain.com/file.html的.htaccess負荷另一個文件

這是我目前的htaccess文件,但是當它運行時,它只是將我重定向到另一個文件。

RewriteEngine On 
RewriteRule file.html http://mydomain.com/file.html [L] 

我在做什麼錯在這裏?

謝謝你們。

回答

2

您需要使用mod_proxy對於這一點,你要求(假設你有一個模塊加載)與the P flag

RewriteRule file.html http://mydomain.com/file.html [P] 

需要注意的是P蘊含L.

+0

是否有任何方法來屏蔽無mod_proxy url ...我使用共享主機 – asvignesh

+0

@Vignesh如果URL位於不同的服務器上,則需要mod_proxy。除此之外,你可以使用