I have done all the said solutions to remove ‘index.php’ from the URI. The procedure I took is as below:
In .htaccess:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
In config.php
the base_url is set to
$config['base_url'] = 'https://trawellmate.com/';
Removed index.php from
$config['index_page'] = '';
These are the suggested solutions. But nothing worked. I am using SSL and all non requests are redirected to https://trawellmate.com. Following is the lines added to achieve in .htaccess:
#FORCE NON-WWW REDIRECT
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^(?:www.)?(.*)$ [NC]
RewriteRule (.*) https://%1%{REQUEST_URI} [L,R=301]
Earlier with non SSL(in development mode in localhost) it was working fine. Since, we are about to go live, a quick help will be deeply appreciated.
3
Answers
Allow overriding htaccess in Apache Configuration (Command)
and edit the file & change to
You may try to use the following rules. It worked for me.
Below .htaccess configuration works for me
I’ve placed the .htacess file in /var/www/html ie. Parallel to application directory
Hope you have enabled mod_rewrite module for apache, Also add below block in virtualhost file(000-default.conf) of apache. Please restart server after changes.