Note that there are some explanatory texts on larger screens.

plurals
  1. POApache/PHP url parse issue
    primarykey
    data
    text
    <p>So, I am playing with urls a bit with a PHP app I am building.</p> <p>I am using mod_rewrite using .htaccess. Here is what that looks like:</p> <pre><code>&lt;IfModule mod_rewrite.c&gt; RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*) index.php/$1 &lt;/IfModule&gt; </code></pre> <p>I thought if a URL was written like below:</p> <pre><code>http://localdomain.com/controller </code></pre> <p>I would expect 'controller' ending without issues as part of the $_SERVER['PATH_INFO']. However, on Ubuntu 12.04 running Apache 2.2.22 I get a 404 Not Found error instead:</p> <pre><code>NOT FOUND The requested URL /index.php/controller was not found on this server. </code></pre> <p>It appears that 'controller' is being properly addressed after a slash following index.php, but Does anyone have any idea why I am getting a 404 instead of the expected response?</p> <p>Ultimately I am trying to capture the 'controller' to use in an MVC framework I am building.</p> <p>In this case I have a very simple index.php with ONLY the following:</p> <pre><code>&lt;?php echo $_SERVER['PATH_INFO']; </code></pre> <p>Yet, I still get a 404 error instead of the expected path info.</p> <p>NOTE: Going to just <a href="http://localdomain.com/" rel="nofollow">http://localdomain.com/</a> or <a href="http://localdomain.com/index.php" rel="nofollow">http://localdomain.com/index.php</a> work perfectly. mod_rewrite is on and working, and AllowOverride is set to All.</p>
    singulars
    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. 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