Reputation: 1805
I have answered this question previously and even posted the answer to it by myself. I tried most of the answered questions, but it still didn't work. The first question is regarding placement of the .htaccess
file, should I keep it with application folder or inside it? and the next question is 'How should I remove the index.php
from URL'?
.htaccess code:
RewriteEngine On
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
Config.php code:
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';
and if possible do also suggest a detailed tutorial regarding how to customize TankAuth or any other authentication library which can be easier. I am using Windows 8.1 and Wamp Server.
Any suggestion or help is appreciated.
Upvotes: 0
Views: 4184
Reputation: 11
it works on me, I use v2.2.6 by the way
here is what it looks like
Upvotes: 1
Reputation: 310
1.config.php
$config['index_page'] = 'index.php'; change to $config['index_page'] = '’;
2.Create .htaccess file
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
Upvotes: 0
Reputation: 38584
in config.php
change this
$config['base_url'] = '';
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';
and in .htaccess(NOTE: this should be place outside application folder)
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
Note: There are lot of duplicate question. So before Ask New Question please check your dropdown menu(its comes with when you start typing title of your question) whether its exist or answer provided.
Upvotes: 0
Reputation: 41
i think it will help you,
.htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
in config.php
$http = 'http'.((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 's' : '').'://';
$newurl = str_replace('index.php', '', $_SERVER['SCRIPT_NAME']);
$config['base_url'] = "$http".$_SERVER['SERVER_NAME'].''.$newurl;
$config['modules_locations'] = array('http://localhost/astrido_admin/application/' . 'modules/');
$config['index_page'] = '';
Thanks
Upvotes: 0
Reputation:
Try this htaccess works fine windows 7 and 8.1 and xampp
Make sure you place the .htaccess in main directory and not the application folder.
Options +FollowSymLinks
Options -Indexes
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
Config
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';
More htaccess https://github.com/riwakawebsitedesigns/htaccess_for_codeigniter
Upvotes: 0
Reputation: 375
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
application > config > config.php
$config['base_url'] = '';
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';
definitely it will work.
Upvotes: 0
Reputation: 785
Use this in your .htaccess file:
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]
place ./ before your index.php rewrite rule.
or this
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
For more detail refer link:https://ellislab.com/expressionengine/user-guide/urls/remove_index.php.html
Upvotes: 1