Welcome Guest, Not a member yet? Register   Sign In
Problem with index.php
#1

[eluser]piotrjanczak[/eluser]
In file \application\config\config.php I have
Code:
$config['base_url'] = 'http://subdomain.hosting.org/';
$config['index_page'] = '';

In my .htaccess file I have (http://ellislab.com/codeigniter/user-gui.../urls.html - with some correct)
Code:
RewriteEngine on
RewriteCond $1 !^(index.php|img|css|js|robots.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

In file \application\controllers\kontakt.php
Code:
Class Kontakt extends CI_Controller
{
    public function  __construct() {
        parent::__construct();
        session_start();
    }
    
    public function index()
    {
        echo 'test';
    }

When I open http://subdomain.hosting.org/kontakt/ I have a main stie.
But, when I open http://subdomain.hosting.org/index.php/kontakt/ I have a "test" string on screen.

Where I have a error?
#2

[eluser]piotrjanczak[/eluser]
So, I find solution on this forum, but I "fight" with this problem over 2-3 hours... Finaly, helps mi this post: http://ellislab.com/forums/viewthread/88844/

I change .htaccess file on:
Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|img|css|js|robots\.txt)
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
</IfModule>
#3

[eluser]eggzy[/eluser]
Here's the one I use with HTML5 Boilerplate server config:

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




Theme © iAndrew 2016 - Forum software by © MyBB