<code>example.com</code>. This can be done using the <code class="directive"><a href="../mod/core.html#if"><If></a></code> directive, as shown here:</p>
<pre class="prettyprint lang-config">
-<If "$req{Host} != 'www.example.com'">
- RedirectMatch (.*) http://www.example.com$1
+<If "req('Host') != 'www.example.com'">
+ Redirect / http://www.example.com/
</If>
</pre>
module="core" type="section">If</directive> directive, as shown here:</p>
<highlight language="config">
-<If "$req{Host} != 'www.example.com'">
- RedirectMatch (.*) http://www.example.com$1
+<If "req('Host') != 'www.example.com'">
+ Redirect / http://www.example.com/
</If>
</highlight>