1

My codeigniter project was running successfully without index.php in url. It all started after I upgraded to php 5.6 from 5.4 . During upgradation I have faced several issues regarding apache which I resolved successfully one by one due to which my project is successfully running now but all its asking is index.php in url.

My attempts:

1.I have checked the mod rewrite and enabled it

2.not changed .htaccess content in my project root as it already contains the code to bypass index.php from url

3.I have tried to replace the blank file httpd.conf with

<Directory /var/www>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory><Directory>
    AllowOverride All
</Directory>

4.$config['index_page'] = ''

5.In /etc/apache2/sites_available/default I have

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

Please help me!

Sagar Ch
  • 13
  • 6
  • Please check line 38 on `application/config/config.php`. If it is `$config['index_page'] = 'index.php';` please change it to `$config['index_page'] = '';` – Deniz B. Dec 01 '15 at 06:21
  • @DenizB. it was already $config['index_page'] = ' '; Didn't worked – Sagar Ch Dec 01 '15 at 07:34
  • I have also changed $config['uri_protocol'] = 'AUTO'; to $config['uri_protocol'] = 'REQUEST_URI'; in config.php but did't work. – Sagar Ch Dec 01 '15 at 07:44

1 Answers1

1

May be rewrite mod is not enabled

Execute this in terminal

sudo a2enmod rewrite
sudo service apache2 restart
Abdulla Nilam
  • 36,589
  • 17
  • 64
  • 85
  • rewrite mode was enabled.However I executed the above commands. Didn't worked. – Sagar Ch Dec 01 '15 at 07:32
  • As per the above solution I used sudo a2enmod rewrite o/p : Module rewrite already enabled I went to etc/apache2/sites-available/default found this Options FollowSymLinks AllowOverride All Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all As per that solution there is no where 'AllowOverride None' – Sagar Ch Dec 01 '15 at 08:20
  • After trying many things I succeeded.And the following small change has worked for me In /etc/apache2/apache2.conf,I have changed one line initially it was AllowOverride None which I changed to AllowOverride All Options Indexes FollowSymLinks AllowOverride All Require all granted – Sagar Ch Dec 04 '15 at 16:20