Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>It's possible that your routes aren't resolving correctly, but I'm not sure. I'd recommend the following steps.</p> <p>First, I would just do away with using <code>PATH_INFO</code> for your CodeIgniter routing, as it's not necessary. Change your <code>.htaccess</code> file to this:</p> <pre><code>RewriteEngine On RewriteCond $0 !^(index\.php|images|captcha|css|js|robots\.txt) RewriteRule ^.*$ index.php [L] </code></pre> <p>Then, in your configuration, make sure that <code>$config['uri_protocol']</code> is set to <code>AUTO</code> (the default, I believe) or <code>REQUEST_URI</code>.</p> <p>Following that, the most likely cause is that your routes expect there to be a trailing slash on the URL. I don't know enough about CodeIgniter to know where that particular setting is configured, but you can cause your URLs to have a trailing slash with the following configuration directive:</p> <pre><code>$config['url_suffix'] = "/"; </code></pre> <p><strong>Edit</strong>: Make sure that <code>mod_rewrite</code> is working, as well. Try this at the top of your <code>.htaccess</code> file, after the <code>RewriteEngine</code> directive:</p> <pre><code>RewriteRule .* http://stackoverflow.com/ [L,R] </code></pre> <p>If you get redirected to Stack Overflow, at least we'll know that's working. If not, you aren't getting a 500 error, so the problem would lie with the <code>.htaccess</code> file, and in that case you should confirm that the corresponding <code>&lt;Directory&gt;</code> entry in your server configuration for where your site is located on disk has <code>AllowOverride All</code> set.</p> <p><strong>Edit</strong>: I should have known better about the forward slash, sorry about that. The problem occurs because of how <code>mod_rewrite</code> works in your per-directory (<code>.htaccess</code>) context.</p> <p>Once your URL is rewritten, it is examined to determine what <code>mod_rewrite</code> should do with it. When your URL points to a local resource and contains a leading slash, <code>mod_rewrite</code> leaves it as-is. When it does not, it adds the per-directory prefix.</p> <p>When it's left as-is, an internal redirect to <code>/index.php</code>, in this case, is assumed to be a fully-qualified URL from the host (localhost). So, the resource requested ends up being <code>http://localhost/index.php</code>. When the per-directory prefix is added, a later step in the rewrite engine attempts to remove the <code>DocumentRoot</code> from the path, if it's present. This leaves us with <code>/kids/index.php</code>, which is then passed to the internal redirect, and is resolved as expected.</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