Note that there are some explanatory texts on larger screens.

plurals
  1. POCodeIgniter mod_rewrite gives 404 error
    primarykey
    data
    text
    <p>I have written a CodeIgniter application and I want to use mod_rewrite to clean up my URL's. I have installed the CodeIgniter application in htdocs/ci-intro/</p> <p>Here is my .htaccess file:</p> <pre><code>&lt;IfModule mod_rewrite.c&gt; RewriteEngine On RewriteBase /ci_intro/ #Removes access to the system folder by users. #Additionally this will allow you to create a System.php controller, #previously this would not have been possible. #'system' can be replaced if you have renamed your system folder. RewriteCond %{REQUEST_URI} ^system.* RewriteRule ^(.*)$ /index.php?/$1 [L] #When your application folder isn't in the system folder #This snippet prevents user access to the application folder #Submitted by: Fabdrol #Rename 'application' to your applications folder name. RewriteCond %{REQUEST_URI} ^application.* RewriteRule ^(.*)$ /index.php?/$1 [L] #Checks to see if the user is attempting to access a valid file, #such as an image or css document, if this isn't true it sends the #request to index.php RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [L] &lt;/IfModule&gt; &lt;IfModule !mod_rewrite.c&gt; # If we don't have mod_rewrite installed, all 404's # can be sent to index.php, and everything works as normal. # Submitted by: ElliotHaughin ErrorDocument 404 /index.php &lt;/IfModule&gt; </code></pre> <p>I altered the config.php in CodeIgniter to the following:</p> <pre><code>$config['base_url'] = ''; $config['index_page'] = ''; </code></pre> <p>Whenever I use my links to go to the about page I get a 404 message from CodeIgniter. The URL in my browser seems to be 'cleaned up' though (index.php is removed). This is the URL:</p> <p>'http://localhost:8888/ci_intro/about'</p> <p>Can anybody help me getting rid of the 404 error and actually directing the use to the about page?</p> <p>OS: MAC OS X 10.8.2 (latest) <br /> SERVER SOFTWARE: MAMP <br /> PHP: 5.2.17 <br /> BROWSERS: Chrome &amp; Safari (In both browsers this problem occurs)</p>
    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.
 

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