Note that there are some explanatory texts on larger screens.

plurals
  1. PORouting issues with Slim Framework running on AppFog
    primarykey
    data
    text
    <p>I've been successfully running Slim apps on a couple different servers and tried setting one up on AppFog today using the same structure, but it isn't running normally.</p> <p>I'll start with my directory structure:</p> <pre><code>.htaccess /public .htaccess index.php /routes /Slim </code></pre> <p>The <strong>root .htaccess</strong> file contains the DocumentRoot code from the AppFog docs.</p> <pre><code>RewriteEngine on RewriteCond %{HTTP_HOST} ^brs.aws.af.cm$ [NC,OR] RewriteCond %{HTTP_HOST} ^www.brs.aws.af.cm$ RewriteCond %{REQUEST_URI} !public/ RewriteRule (.*) /public/$1 [L] </code></pre> <p>The <strong>/public</strong> directory is where my api code will go, and the Slim <strong>index.php</strong> and <strong>.htaccess</strong> files currently are. The <strong>index.php</strong> file contains two simple routes:</p> <pre><code>require '../Slim/Slim.php'; \Slim\Slim::registerAutoloader(); $app = new \Slim\Slim(); // Default GET route $app-&gt;get('/', function () { echo "Default GET route"; }); // Hello World route $app-&gt;get('/hello/:name', function ($name) { echo "Hello, $name"; }); $app-&gt;run(); </code></pre> <p>The server is setup at <a href="http://brs.aws.af.cm/" rel="nofollow">http://brs.aws.af.cm/</a> and I've listed the main routes below:</p> <ol> <li>/ => uses the default GET route</li> <li>/hello/john => 404 Error</li> <li>/public/hello/john => works, but requires "/public" in the url</li> </ol> <p>And here's some extra weirdness. Seven-character routes result in a 404 error, six or less end up using the default GET route.</p> <ol> <li>/123456 => shouldn't work, but uses the default GET route</li> <li>/1234567 => 404 error</li> </ol> <p>I'm completely stumped. I figure it has something to do with the DocumentRoot code, but I'm not sure what exactly. I've also tried setting </p> <pre><code>RewriteBase /public/ </code></pre> <p>in <strong>/public/.htaccess</strong> but it doesn't seem to affect anything.</p> <p>Any help would be greatly appreciated. Thanks!</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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