Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>In mod_rewrite there are two concepts, named redirect and internal rewrite.</p> <p><strong>Redirect</strong></p> <p>Mod_rewrite can redirect a request from a to b. This is indicated by the <code>[R]</code> flag behind the rule. If the user requests, for example <code>http://foo.example.com</code>, you can redirect it to <code>http://bar.example.com</code>. What this does, is that you tell the client that the page has been moved to <code>http://foo.com</code> and that they should redo the request to that url. It'll show <code>http://foo.com</code> in the address bar.</p> <p><strong>Internal rewrite</strong></p> <p>Mod_rewrite can also internally rewrite url's if the file you want to show is in the same filesystem. This is indicated by the <em>absence</em> of the <code>[R]</code> flag. If the user requests <code>http://foo.example.com</code>, you internally rewrite it to a file that could also be reached by <code>http://bar.example.com</code>, assuming that both <code>foo.example.com</code> and <code>bar.example.com</code> are in the same filesystem. This would show <code>http://foo.example.com</code> in the address bar, but would actually show a file that can also be reached by <code>http://bar.example.com</code>. Please note that search engines will believe they are 2 different pages with exactly the same content, and might penalize your website for this.</p> <p><strong>Your case</strong></p> <p>In your case you seem to be requesting an internal rewrite and not a redirect like the title suggests. Without the structure of the filesystem I can't really test anything, but something like this should suffice.</p> <pre><code>RewriteRule ^path/to/subdomain1/(.*)$ path/to/subdomain2/$1 [L] </code></pre>
 

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