Welcome Guest, Not a member yet? Register   Sign In
drop index.php when CI is a sub-dir?
#1

[eluser]LiorBroshi[/eluser]
Hi There,

I can't figure out how to drop index.php from my website's address.
the main public_html is used for the actual site assets and everything else is under /codeigniter dir.

the structure of the files is:

/public_html/
-> /images/
-> /css/->
-> /js/
-> /codeigniter/
---> /application
---> /system
-> index.php

now index.php is the CI's started, and inside it the app is defined to:
$application_folder = "codeigniter/application";

How can i set CI to avoid index.php (config.php + .htaccess) ?

Lior.
#2

[eluser]Phil Sturgeon[/eluser]
Why not move the index.php into /codeigniter/ and do it as normal? Then modify your .htaccess rule from:

Quote:RewriteRule ^(.*)$ index.php/$1 [L]

to:

Quote:RewriteRule ^(.*)$ codeigniter/index.php/$1 [L]
#3

[eluser]LiorBroshi[/eluser]
hmmm

Now it gives me a 500 Internal Server Error...maybe it became recursive? ;-)
#4

[eluser]theprodigy[/eluser]
or leave your htaccess file the way it is,
Code:
RewriteRule ^(.*)$ index.php/$1 [L]
and move it and the index.php file into the /codeigniter directory
#5

[eluser]Phil Sturgeon[/eluser]
That would require /codeigniter to be in the URL. Yuck.
#6

[eluser]LiorBroshi[/eluser]
sooooooooo

What Can I do? can someone please show me the entire .htaccess file that I can use when codeigniter is under a /codeigniter dir in the root dir? i'm lost...

Lior.
#7

[eluser]rogierb[/eluser]
It doesnt matter where you index.php is located. As long as the folders are set correctly within index.php
and the .htaccess resides in the same folder as index.php

You probabaly need something like:
config.php:
$config['index_page'] = "";

index.php:
$system_folder = "codeigniter/system";
$application_folder = "codeigniter/application";

.htaccess
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
#8

[eluser]razzatrox[/eluser]
I got mine to work with this:
"
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css)
RewriteRule ^(.*)$ /CodeIgniter/index.php/$1 [L]
"
#9

[eluser]LiorBroshi[/eluser]
err now I get Internal Server Error....

What should I do?
#10

[eluser]rogierb[/eluser]
It might be usefull if you post your .htaccess and other related information.

We are willing to help but without information that is just impossible.




Theme © iAndrew 2016 - Forum software by © MyBB