I am using CodeIgniter on the Home windows machine while using Zend Comunity Server with apache. My apache is correctly set up to deal with .htaccess directives and mod_rewrite is enabled (httpd.conf):

<Directory />
    Options FollowSymLinks
    AllowOverride FileInfo
    Order deny,allow
    Deny from all

My root is C:\www\ and my website is situated in C:\www\david\ so when I type http://localhost/david/, the index.php is loaded together with the right controller. I wish to access my things directly through http://localhost/david/Articles/ rather than http://localhost/david/index.php/Articles/. To get this done I must use apache rewrite module.

To do this, I have placed a .htaccessfile within the C:\www\david\ folder. This file consists of code I discovered on here :

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /david/

    #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} ^core.*
    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]

<IfModule !mod_rewrite.c>
    # 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

I made a few changes towards the code since my configuration is a little not the same as the default. I am this is not on the main so : 'RewriteBase /davidfrancoeur.com/' and I have re-named the CodeIgniter system folder for further security so : RewriteCond % ^core.* RewriteRule ^(.*)$ /index.php?/$1 [L]

With this particular done, anything should work correctly, I ought to have the ability to access http://localhost/david/Articles/ with no problem and i believe I should not have the ability to achieve http://localhost/david/core/config/config.php directly.

Regrettably, it does not work, it does not even seem like any spinning is performed. Would you find out if I am doing a problem here? It is possible to method to determine if apache really rewrite anything?

Thanks. Company I checked out the countless article I possibly could found relating to this... :(


CI 2..2, PHP 5.3, Apache 2.2

It'll work.....really the first two rewrite conditions and rules will work however in third reqrite condition you're permitting user to gain access to request file ,even when it's core or system file.

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !^core.*
    RewriteCond %{REQUEST_FILENAME} !^system.*
    RewriteRule ^(.*)$ index.php?/$1 [L]