index.php on subdirectory

I have developed some web application using CI.
I always put index.php on root directory.
When I installed into my client computer, they have index.php and .htaccess too on root directory.
I think I must move my index.php into subdirectory like /sub, but my application does not work well.

Can anyone help me how to configure .htaccess when I put my index.php on /sub/index.php ?
because when I access CI says "Page not found"

[eluser]Pascal Kriete[/eluser]
A really useful thing would be the content of your .htaccess, but assuming you're using the default:
// Change this:
RewriteRule ^(.*)$ /index.php/$1 [L]
// to:
RewriteRule ^(.*)$ index.php/$1 [L]
// or:
RewriteRule ^(.*)$ /sub/index.php/$1 [L]

I prefer option no. 1
RewriteRule ^(.*)$ index.php/$1 [L]
It works in any situation

I'm using CI default configuration.

how about
RewriteBase /

should be changed to

RewriteBase /sub/

Use whichever tickles your pickle. Good luck.

And Welcome to CI forums Wink

It realy nice, so simple. I'm using /sub/.htaccess
RewriteEngine on
RewriteCond $1 !^(index\.php|images|design|css|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]

Sweet. That worked for me too.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.