Welcome Guest, Not a member yet? Register   Sign In
Upgrade to 2.0.1 from 1.7.3 -> Cannot figure out how to hide index.php again.
#1

[eluser]\/ertigo[/eluser]
I am working on migrating from CodeIgniter 1.7.3 to 2.0.1. Everything seems to work once I have renamed all my controllers/models with the new prefix but I cannot figure out how to hide index.php under the new version though: it worked fine under 1.7.3. CodeIgniter seems to find the system and application folders fine: when I go to https://www.myserver.com/wip/ I get the codeigniter 404 page; https://www.myserver.com/wip.php/ will give me my application.
I have changed the following in config.php:
$config['base_url'] = 'https://www.myserver/wip.php/'; (works)
$config['base_url'] = 'https://www.myserver/wip/'; (doesn't work)
$config['index_page'] = '';
$config['url_suffix'] = '.html';

I have changed the following in wip.php (aka index.php):
$system_path = '../wip';

If I change the system_path or application_folder settings I get an error that the system/application folder paths do not seem to be set correctly. That, combined with the codeigniter 404 page leads me to believe that those are set correctly.

CodeIgniter has been installed in /home/server/wip/ (application folder + all the folders out of system). index.php has been renamed to wip.php and installed in /home/server/ssl

The relevant lines from httpd.conf (I am using Apache 2.2.17/PHP 5.2.17):
<Directory "/home/server/ssl">
Allow from all
Options Indexes FollowSymLinks
AllowOverride FileInfo Options
Order allow,deny
SSLRequireSSL
RewriteEngine on
RewriteRule ^wip$ /wip/ [R]
RewriteRule ^wip/(.*)$ wip.php/$1 [L]
</Directory>

What am I missing?
#2

[eluser]Glazz[/eluser]
Code:
<IfModule mod_rewrite.c>
    RewriteEngine on
    Options +FollowSymLinks
    RewriteBase /
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1
</IfModule>
#3

[eluser]\/ertigo[/eluser]
Thanks for your reply although those are .htaccess options and I was looking for httpd.conf options (I usually have AllowOverride set to None but was doing some experimenting with some CMSs that required it).

At any rate it encouraged me to play with the mod_rewrite options a little more and was able to determine that was not my problem (I ended up redirecting to phpinfo() to see what was going on).

It looks like CodeIgniter 2 handles URLs a little differently than 1.7.3. I was able to solve my problem by changing the following options in config.php:
1.7.3: $config[‘base_url’] = ‘https://www.myserver.com/wip/’
2.0.1: $config[‘base_url’] = ‘https://www.myserver.com/’

1.7.3: $config[‘index_page’] = ‘’
2.0.1: $config[‘index_page’] = ‘wip’

1.7.3: $config['uri_protocol'] = 'AUTO';
2.0.1: $config['uri_protocol'] = 'PATH_INFO';

Thanks again: hopefully this helps someone else struggling with a similar problem.




Theme © iAndrew 2016 - Forum software by © MyBB