Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>First of all you need to route all your urls through some kind of url re-writer function. </p> <p>So you no longer do:</p> <pre><code>&lt;a href="some/path/"&gt;Foo&lt;/a&gt; </code></pre> <p>But instead something like:</p> <pre><code>&lt;a href="&lt;%= url_for('some/path') %&gt;"&gt;Foo&lt;/a&gt; </code></pre> <p>All the web frameworks out there have a function like this. While they usually do all kinds of magic in there (to do with MVC controller paths and views and what not), at the end of the function (conceptually) they all prepend your url with a "root" (eg <code>"/this/is/where/the/app/is/"</code>), so as to allow you to create urls in your application that are independent of a hard-coded base path.</p> <p>RoR uses a configuration directive called <a href="http://www.hostingrails.com/37/ActionController-AbstractRequestrelative_url_root" rel="nofollow noreferrer"><code>"relative_url_root"</code></a>.</p> <p>Symfony (php) uses a configuration directive also called <a href="http://trac.symfony-project.org/wiki/InstallingSymfonyInASubDirectory#UpdatetheRelativeRoot" rel="nofollow noreferrer"><code>"relative_url_root"</code></a>.</p> <p>CakePHP uses a configuration directive called <a href="http://www.chriscassell.net/log/2006/07/27/how_to_install_.html" rel="nofollow noreferrer"><code>"WEBROOT_DIR"</code></a>.</p> <p>In cases where these frameworks are running on Apache, this value is often calculated dynamically (if you haven't set it explicitly). On other webservers the environment variables are often not available or are incorrect so this value cannot be determined consistently.</p>
 

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