1

I am newbie in Codeigniter and trying to configure Codeigniter.

But i am unable to remove the index.php from url..

I changed the .htaccess file by following data which was given in userguide..

.htacess file contains

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

and also changed the config file

$config['index_page'] = '';

when i try to use the following url it results

The requested URL /codeigniter/pages/view was not found on this server.

http://localhost/codeigniter/pages/view

But i try with index.php in url..The page shown normally..

http://localhost/codeigniter/index.php/pages/view

Is that .htaccess problem or i have to change some other files..?

How to get rid of this problem?

Any Suggestions, acceptable.

Update

I am using ubuntu 3.10

I used the following command to enable module rewrite

 sudo a2enmod rewrite

The result as follows

  Module rewrite already enabled

I changed the permissions in

  /etc/apache2/sites-enabled/000-default

As

ServerAdmin webmaster@localhost

DocumentRoot /var/www
<Directory />
    Options FollowSymLinks
    AllowOverride All
</Directory>
<Directory /var/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
</Directory>

After changing this file also no luck..

Community
  • 1
  • 1
PHP CODER
  • 1,553
  • 4
  • 17
  • 34

4 Answers4

1

Finally i found the answer to my question.As the below .htaccess solved my problem..

    <IfModule mod_rewrite.c>

     RewriteEngine On
     RewriteCond %{REQUEST_FILENAME} !-f
     RewriteCond %{REQUEST_FILENAME} !-d
     RewriteCond $1 !^(index\.php)
     RewriteRule ^(.+)$ index.php?/$1 [L,QSA]

    </IfModule>

Thanks to all..

PHP CODER
  • 1,553
  • 4
  • 17
  • 34
0

in your httpd.conf (on windows)

uncomment below line

LoadModule rewrite_module modules/mod_rewrite.so

in ubuntu enable mod_rewrite using sudo a2enmod rewrite

Restart apache after making changes

Ravikumar Sharma
  • 3,678
  • 5
  • 36
  • 59
0

Make this changes

In config.php

$config['index_page'] = '';

IN root .htaccess file

DirectoryIndex index.php

RewriteEngine On

RewriteCond $1 !^(index\.php|themes|utils|robots\.txt|favicon\.ico)

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ ./index.php?/$1 [L]
MAK
  • 773
  • 4
  • 9
  • 30
  • It's not accepting in my ubuntu 3.10 and showing the same not found message – PHP CODER Mar 06 '14 at 13:11
  • check this url in stack over flow : http://stackoverflow.com/questions/14848325/trying-to-remove-index-php-from-url-in-codeigniter – MAK Mar 06 '14 at 13:16
0

Nobody mentioned change the setting. In your httpd config file find and change it like this

<Directory "/var/www/html">  # your DocumentRoot setting
    Options FollowSymLinks
    AllowOverride All  # default is None
    Order allow,deny
    Allow from all
</Directory>
Darren20
  • 90
  • 1
  • 7