0

I've changed $config['index_page'] to

$config['index_page'] = ''

and also updated my .htaccess file content to:

RewriteEngine on
RewriteCond $1 !^(index\.php|public|\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1

but I can't access controllers without putting index.php in my url. So what should I do next?

5
  • Do you run your server on Linux or Windows? Commented Aug 1, 2013 at 10:35
  • @cuewizchris, I'm running on windows Commented Aug 1, 2013 at 10:36
  • 1
    You need to ensure that your rewrite engine is running and - perhaps - there is a line in your vhost config that you need to change (from "AllowOverride None" to "AllowOverride All"). I'm not sure how these steps are supposed to be done on Windows, tho. Commented Aug 1, 2013 at 10:41
  • .htaccess is not turned on by default on a windows server. Make sure first this is the case. Take a look at this response and article about configuring it: stackoverflow.com/questions/14148489/… Commented Aug 1, 2013 at 10:44
  • Have a look in this post ..... stackoverflow.com/questions/17852585/… Commented Aug 1, 2013 at 11:51

2 Answers 2

0

try with following .htaccess, it works fine for me.

# index file can be index.php, home.php, default.php etc.
DirectoryIndex index.php

# Rewrite engine
RewriteEngine On

# condition with escaping special chars
RewriteCond $1 !^(index\.php|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]
Sign up to request clarification or add additional context in comments.

Comments

0

try this one

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]

put this code in your root folder htaccess file and clear your application folder htaccess file's content.

please let me know if you face any problem.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.