0

I have follow http://searchdaily.net/codeigniter-2-smarty-3-integration/ that tutorial for integrating Smarty 3.1.14 to CodeIgniter 2.1.3, everything is working perfectly except for my links, when i try to navigate between my smarty files it goes to ex: http://local.host/project/index.php/Smartytest <- what i need to do is to avoid the index.php and just enter as //local.host/project/Smartytest

in my test it says:

$SCRIPT_NAME is /cismarty-new/index.php

I just want to hide index.php so i can do /cismarty-new/Smartytest for example instead of /cismarty-new/index.php/Smartytest

thanks

Carlos Sanchez
  • 35
  • 1
  • 2
  • 12
  • Possible duplicate, http://stackoverflow.com/search?q=%5Bcodeigniter%5D+remove+index.php – Aurel Jul 03 '13 at 11:27
  • not a duplicate its not the same problem, i've integrated CI + Smarty, with codeigniter the index.php doesnt appears, i can go to localhost/site/welcome and it works fine, but when i try with Smarty i have to put localhost/site/index.php/welcome to display it that is the real problem – Carlos Sanchez Jul 03 '13 at 21:37
  • Have you try set `index_page` config in **config.php** ? – Aurel Jul 04 '13 at 01:20
  • Note: your `SCRIPT_NAME` value is normal and it will not change anyway. – Aurel Jul 04 '13 at 01:31
  • yes i tried index_page in config.php, default is $config['index_page'] = 'index.php'; i removed index.php and rename it and it doesnt work – Carlos Sanchez Jul 04 '13 at 06:46
  • http://www.blacklyontech.com/cismarty-new.rar – Carlos Sanchez Jul 04 '13 at 06:49
  • go to localhost/cismarty-new then go to localhost/cismarty-new/index.php/testsmarty thats the problem – Carlos Sanchez Jul 04 '13 at 06:51
  • i don't see your `.htaccess` file and you told me it's not a duplicate.., have you create one to remove index.php in CI URIs ? – Aurel Jul 04 '13 at 13:08
  • when i create a view with CI it remove the index.php but when i create a view with Smarty it only work if i first type /index.php/example – Carlos Sanchez Jul 04 '13 at 14:08
  • Please set an .htaccess file with right configurations for CI and tell me after that. See my first comment. – Aurel Jul 04 '13 at 15:06
  • http://stackoverflow.com/questions/16503333/remove-index-php-from-codeigniter-path <- That one worked! The Fifth Link of url you gave me.. Thanks lighta for guiding me! – Carlos Sanchez Jul 05 '13 at 00:11

1 Answers1

0

have you tried using .htaccess ?

if you have not tried then do the fowling and see if it resolves the problem:

create a .htaccess file in the root of your folder (inside cismarty-new/), copy the code and save it.

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

then open the codeigniter config.php and leave the $config['index_page'] blank:

$config['index_page'] = '';

PS: Remember to check if you have Apache's "rewrite_module" activated, otherwise it will not work.