Welcome Guest, Not a member yet? Register   Sign In
Cannot access controller without index.php ini live server
#1

[eluser]zeltranq[/eluser]
Hai,

I am having a problem with accessing my controller without using index.php in my url.

some.example.com/controller , its return 404 error but when i use some.example.com/index.php/controller its run very well. And this situation just happen in live server, for the localhost i got no problem like this

in my config.php i change
Code:
$config['index_page'] = 'index.php';
to
Code:
$config['index_page'] = '';

I actually use htaccess
Code:
<IfModule mod_rewrite.c>
    Options +FollowSymlinks
    RewriteEngine On

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

Is there any one could help me?
#2

[eluser]noideawhattotypehere[/eluser]
Are you on a shared hosting or your own server? If the second one, can you show your virtual host entry?
#3

[eluser]zeltranq[/eluser]
[quote author="noideawhattotypehere" date="1386769764"]Are you on a shared hosting or your own server? If the second one, can you show your virtual host entry?[/quote]

I am not very familiar with server setting, but if you mean my virtualhost setting maybe like this one:
Code:
<VirtualHost *:80>
        ServerAdmin [email protected]
        DocumentRoot /var/www/domain/some.example.com/html
        ServerName some.example.com
        #ServerAlias some.example.com
        <Directory /var/www/domain/some.example.com/html>
            AllowOverride All
            Allow from all
        </Directory>
        AccessFileName .htaccess
</VirtualHost>
#4

[eluser]noideawhattotypehere[/eluser]
Code:
RewriteEngine on
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?/$1 [L,QSA]

Try only with this. If it doesnt work, make sure your htaccess is saved as utf-8 without BOM? Not sure if apache makes problems with that but better check it. Your Vhost seems fine, thought maybe your AllowOverride entry is set to None but thats not the problem as I see.
#5

[eluser]zeltranq[/eluser]
[quote author="noideawhattotypehere" date="1386771356"]
Code:
RewriteEngine on
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?/$1 [L,QSA]

Try only with this. If it doesnt work, make sure your htaccess is saved as utf-8 without BOM? Not sure if apache makes problems with that but better check it. Your Vhost seems fine, thought maybe your AllowOverride entry is set to None but thats not the problem as I see.[/quote]

Thanks noideawhattotypehere for the advice. I just upload other apps using CI and it work perfectly, my assumptions I've done something bad somewhere in my CI file




Theme © iAndrew 2016 - Forum software by © MyBB