I uploaded codeigniter project on server.Removing index.php from URL is not working. I access it using IP address. like http://ip address/
Below is my htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
/etc/apache2/apache2.conf
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
I tried all possible solutions found on google. but not working for me.
Please follow some step:
goto application/config/config.php :
replace $config['index_page'] = 'index.php';
to $config['index_page'] = '';
and
$config['uri_protocol'] = 'REQUEST_URI';
to $config['uri_protocol'] = 'AUTO';
enable rewrite mode by
sudo a2enmod rewrite
then
service apache2 restart
if you'd like, you can use the following .htaccess file.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
in httpd.conf, edit or delete "index.php":
<IfModule dir_module>
DirectoryIndex index.php
</IfModule
Then in htaccess, add this:
Options -Indexes
Add below code in .htaccess. Hope this work.
Options All -Indexes
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
Set your .htaccess
as below
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
Then open /etc/httpd/conf/http.conf
file and find <Directory "/var/www/html">
with in this find and set AllowOverride None
to AllowOverride All
.