Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If <code>www.newdomain.com</code> and <code>sub.maindomain.com</code> are on different hosts, the only way to get the content on <code>sub.maindomain.com</code> to be served while the browser's URL address bar says <code>www.newdomain.com</code> is to fetch the content from <code>sub.maindomain.com</code> <em>on behalf of the browser</em>. Since as far as the browser is concerned, it's looking at content on newdomain.</p> <p>You can do this either by setting up a proxy using apache or maybe a script. Using apache, you'd need access to your vhost config for the <code>www.newdomain.com</code> domain. You can set it up like:</p> <pre><code>ProxyPassMatch ^(.*)$ http://sub.maindomain.com$1 </code></pre> <p>Take a look at the <a href="http://httpd.apache.org/docs/2.2/mod/mod_proxy.html" rel="nofollow">mod_proxy docs</a> for more info on the flags you can pass this directive, to tweak timeouts and retries.</p> <p>If you want to setup a php script to proxy, you'll need to route all requests to this php script, so in your htaccess file in your <code>www.newdomain.com</code> document root, add (assuming this php script is called <code>proxy.php</code>):</p> <pre><code>RewriteEngine On RewriteCond %{REQUEST_URI} !^/proxy.php RewriteRule ^(.*)$ /proxy.php?url=$1 [L,QSA] </code></pre> <p>Then in <code>proxy.php</code>, look for the <code>url</code> query string, load that page, and output it to the browser.</p> <p>Though all of this is much easier if you can just point both domains to the same host.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload