index.php on subdirectory

#1
[eluser]Lima[/eluser]
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 http://www.clientsite.com/sub/ CI says "Page not found"

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

#3
[eluser]wiredesignz[/eluser]
I prefer option no. 1
Code:
RewriteRule ^(.*)$ index.php/$1 [L]
It works in any situation

#4
[eluser]Lima[/eluser]
I'm using CI default configuration.

how about
Code:
RewriteBase /

should be changed to

RewriteBase /sub/

#5
[eluser]wiredesignz[/eluser]
Use whichever tickles your pickle. Good luck.

And Welcome to CI forums Wink

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

#7
[eluser]Unknown[/eluser]
Sweet. That worked for me too.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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