LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Apache Proxy Rewrite all links (https://www.linuxquestions.org/questions/linux-server-73/apache-proxy-rewrite-all-links-4175519775/)

kribo 09-22-2014 10:25 PM

Apache Proxy Rewrite all links
 
hello, im new member LQ.

i have a problem with apache proxy.

my scenario is,

- i have webserver in intranet intranet.com and i have example.com webserver to forward all webserver intranet.com .
- my configuration apache is work. all user in internet can access intranet.com via example.com.
- all links on webpage example.com is ready be writen with example.com for example, if int intranet.com have link intranet.com/login.php its already be writen with example.com/login.php

- problem appears when client try to login that web, after user enter username and password the client web browser always attempt to link intranet.com NOT example.com.

here my apache proxy configuration for that web.

Code:

NameVirtualHost *:80

<VirtualHost *:80>
        ServerAdmin admin@example.com

        RewriteEngine On

        RewriteCond %{HTTP_HOST}  !^example\.com [NC]
        RewriteCond %{HTTP_HOST}  !^$
        RewriteRule ^/(.*)        intranet.com/$1 [L,R]

        ProxyRequests Off
        ProxyHTMLEnable On

        ProxyPass /forum http://intranet.com/
        ProxyPassReverse /forum http://intranet.com/
        SetOutputFilter INFLATE;proxy-html;DEFLATE
        ProxyHTMLURLMap http://intranet.com/ /forum/


        ErrorLog "/var/log/apache/rileks-error.log"
        CustomLog "/var/log/apache/rileks-access.log" common

</VirtualHost>

please your advice :D.
sorry for my bad english.


All times are GMT -5. The time now is 07:06 AM.