Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here's the tip: <em>you don't need to do a redirect actually</em>.</p> <p>Just have <strong>one</strong> vhost that handles both domains.</p> <p>Just do an internal rewrite, and it will work.</p> <p>Here's a mix of my own vhost (<em>that handles <code>domain.com</code> and all <code>*.domain.com</code></em>) and what you'd like (this may not work 100% but hey I give you two hints after this): </p> <pre><code>&lt;VirtualHost *&gt; ServerAdmin webmaster@domain.fr DocumentRoot "/web/htdocs/domain/prod/website" ServerName domain.com ServerAlias *.domain.com ErrorLog "/web/logs/domain.error.log" CustomLog "|/opt/httpd/bin/rotatelogs /web/logs/domain/access_log.%Y-%m-%d-%H_%M_%S.log 5M" combined # your RewriteRules () RewriteEngine On # Trace: # (!) file gets big quickly, remove in prod environments: RewriteLog "/web/logs/domain.rewrite.log" RewriteLogLevel 9 # Your RewriteRules () RewriteCond %{HTTP_HOST} ^wiki.domain.com$ RewriteRule ^/forum/(.*) /wiki/index.php?wiki/index$1 [QSA,L] &lt;/VirtualHost&gt; </code></pre> <h2>Two hints:</h2> <p>If you're not in a hosted environment (= if it's your own server and you can modify the virtual hosts, not only the <code>.htaccess</code> files), try to use the <code>RewriteLog</code> directive: it helps you to track down such problems:</p> <pre><code># Trace: # (!) file gets big quickly, remove in prod environments: RewriteLog "/web/logs/mywebsite.rewrite.log" RewriteLogLevel 9 RewriteEngine On </code></pre> <hr> <p>My favorite tool to check for regexp:</p> <p><a href="http://www.quanetic.com/Regex" rel="nofollow">http://www.quanetic.com/Regex</a> (don't forget to choose ereg(POSIX) instead of preg(PCRE)!)</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. This table or related slice is empty.
    1. This table or related slice is empty.
    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