How to set up frame forwarding for Apache manually?

Created:

2017-04-25 14:18:42 UTC

Modified:

2017-08-16 17:21:13 UTC

0

Was this article helpful?


Have more questions?

Submit a request

How to set up frame forwarding for Apache manually?

Applicable to:

  • Plesk for Linux

Question

How to set up frame forwarding for a website on Apache web server manually?

Answer

Here are possible ways how to do it for example.com website:

  • Add the following code in /var/www/vhosts/example.com/httpdocs/.htaccess file:

    <IfModule proxy_http_module>
            RewriteEngine On
            RewriteCond %{HTTP_HOST} ^(www\.)?example\.com$ [NC]
            RewriteRule ^(.*) http://example2.com/ [P]
    </IfModule>

    Note: proxy_http Apache module should be activated under Tools & Settings > Apache Web Server .

  • Add the following Apache directives in Plesk under Domains > example.com > Apache & nginx Settings :

    <IfModule proxy_http_module>
     RewriteEngine On
     RewriteCond %{HTTP_HOST} ^(www\.)?example\.com$ [NC]
     RewriteRule ^(.*)$ http://example2.com/$1 [P]
    </IfModule>

    Note: proxy_http Apache module should be activated under Tools & Settings > Apache Web Server .

  • Create /var/www/vhosts/example.com/httpdocs/index.html file with the following content:

    <HTML>
    <HEAD>
    <TITLE>example.com</TITLE>
    </HEAD>
    <FRAMESET>
    <FRAME SRC="http://example2.com/" NORESIZE>
    <NOFRAMES>
    Your browser does not support frames.
    </NOFRAMES>
    </FRAMESET>
    </HTML>
Have more questions? Submit a request
Please sign in to leave a comment.