Welcome Guest, Not a member yet? Register   Sign In
How to remove “index.php” in codeigniter's path
#1

[eluser]eladr[/eluser]
Hi,
I'm pulling mu hair for that.It just not working.(always not found)
php is on apache \windows 7.

1) .htaccess on the root folder (where index.php is)

RewriteEngine on
RewriteCond $1 !^(index\.php|[Javascript / CSS / Image root Folder name(s)]|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

2) enabled LoadModule rewrite_module in conf
3) config:
$config['index_page'] = '';

what else can be done? should i change something in httpd-vhosts.conf?
i tried many combinations on the htaccess so i believe the problem is not there.

thanks in advance




#2

[eluser]Tpojka[/eluser]
You didn't tell what message you got if you type http://localhost/project/controller/method/argument
Is set base_url() ?
Try to remove slash before index.php/$1 - for me sometimes it works with and sometimes without slash depending on server.
#3

[eluser]eladr[/eluser]
Thanks,
if i omit the index.php im getting "not found" message...
i will try what u suggested (not in front of my pc now)

is it matter i changed the c:\windows\system32......\hosts and made
127.0.0.1 myServerName
?
(instead of access as localhost)
#4

[eluser]Tpojka[/eluser]
I don't think it is, but try with localhost too.
You forgot to point RewriteBase in htaccess file.
There is other topic here about this subject.
See what is there. Or google for "farinspace codeigniter htaccess".
#5

[eluser]Sceok[/eluser]
I'm not a pro but can't it have something to do with the route ?
#6

[eluser]eladr[/eluser]
I changed the .htaccess to this:
Code:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php?/$1

and just nothing.sooo FRUSTRATING....
i checked every solution in google...
#7

[eluser]eladr[/eluser]
I got it!
this did the magic...changes in httpd.conf and restart apache

Code:
#
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride All

thanks...




Theme © iAndrew 2016 - Forum software by © MyBB