Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This issue should be solved in your webserver configuration.</p> <h1>I want to redirect</h1> <h2>Apache HTTPD Server</h2> <p>If you use Apache, you can create a second VirtualHost for wiki.nikunj.com, with the purpose to redirect to www.nikunj.com/wiki.</p> <p>With mod_rewrite:</p> <pre><code>&lt;VirtualHost *:80&gt; ServerName wiki.nikunj.com RewriteEngine on RewriteRule ^/(.*) http://www.nikunj.com/wiki/$1 [R,L] &lt;/VirtualHost&gt; </code></pre> <p>With mod_alias:</p> <pre><code>&lt;VirtualHost *:80&gt; ServerName wiki.nikunj.com RedirectMatch ^/(.*) http://www.nikunj.com/wiki/$1 &lt;/VirtualHost&gt; </code></pre> <h2>Nginx</h2> <p>Nginx syntax is more intuitive in this case:</p> <pre><code>server { server_name wiki.nikunj.com rewrite ^ http://www.nikunj.com$request_uri? permanent; } </code></pre> <h1>I want to keep the URL in wiki.</h1> <h2>Apache</h2> <p>You need both mod_rewrite and mod_proxy. Then, it would be something like:</p> <pre><code>&lt;VirtualHost *:80&gt; ServerName wiki.nikunj.com RewriteEngine on RewriteRule ^/(.*) http://www.nikunj.com/wiki/$1 [R,L,P] &lt;/VirtualHost&gt; </code></pre> <h2>Nginx</h2> <pre><code>server { server_name wiki.nikunj.com proxy_pass http://www.nikunj.com/wiki; } </code></pre> <h2>What about short URLs?</h2> <p>You can use short URLs in this scenario.</p> <p>You'll need two rules instead one, one for the articles (e.g. /view/$1), one for the other index.php links.</p> <p><strong>Tip:</strong> <code>last</code> in Nginx and <code>[L]</code> in Apache HTTPD means the current rule is the last executed. This will allow you to avoid the two rules are executed one after the other.</p> <h1>Documentation</h1> <ul> <li>Apache: <a href="http://httpd.apache.org/docs/2.4/rewrite/" rel="nofollow">mod_rewrite documentation</a></li> <li>Apache: <a href="http://httpd.apache.org/docs/2.4/rewrite/proxy.html" rel="nofollow">mod_rewrite for Proxying</a></li> <li>Nginx: <a href="http://wiki.nginx.org/HttpRewriteModule" rel="nofollow">HttpRewriteModule</a></li> <li>Nginx: <a href="http://wiki.nginx.org/HttpProxyModule" rel="nofollow">HttpProxyModule</a></li> </ul>
    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.
    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