CodeIgniter Forums
single system folder help - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: single system folder help (/showthread.php?tid=26853)

Pages: 1 2


single system folder help - El Forum - 01-25-2010

[eluser]sasori[/eluser]
Hi, here's my document tree
Code:
htdocs
      /apps
           /codeignitersystemfolder
           /firstapp/
                    /application
                    /images
                    /css
                    /js

then I set up a virtual host

Code:
<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "C:/xampp/htdocs/apps/"
    ServerName apps
    ServerAlias apps apps.com
</VirtualHost>

and then I added an .htaccess file inside the "firstapp" folder

Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|captcha|css|js|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

and then i went to the "config.php" and set the variable $config['index_page'] as

Code:
$config['index_page'] = "";

I restarted my xampp. then I placed a simple hello world index() controller and called a view file, but then when I typed
"http://apps/firstapp"
on my browser bar, it says object not found , why is that?

the hello world only comes out if I typed
"http://apps/firstapp/index.php"

did i do something wrong ?
the default controller is "welcome" from the routes.php


single system folder help - El Forum - 01-25-2010

[eluser]Colin Williams[/eluser]
Have you told Apache to allow overrides for the C:/xampp/htdocs/apps directory?


single system folder help - El Forum - 01-25-2010

[eluser]sasori[/eluser]
i supposed this is correct sir?
Code:
<Directory "C:/xampp/cgi-bin">
    AllowOverride All
    Options None
    Order allow,deny
    Allow from all
</Directory>
it was already set,
there are only 4 of them "AllowOverride" word in the file of apache


single system folder help - El Forum - 01-25-2010

[eluser]Colin Williams[/eluser]
Well, C:/xampp/cgi-bin/ has little to do with C:/xampp/htdocs/apps/ so no.

To be sure, add it to your virtual host directive:

Code:
<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "C:/xampp/htdocs/apps/"
    ServerName apps
    ServerAlias apps apps.com
    <Directory "C:/xampp/cgi-bin">
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

Take some time to learn about your server.


single system folder help - El Forum - 01-25-2010

[eluser]pwfraley[/eluser]
Hi I am pretty new to CI,

so I might be totally of here, but did you try:

http://apps/firstapp/

or

http://apps/firstapp/CONTROLLERNAME/

or

http://apps/firstapp/CONTROLLER/FUNCTIONNAME/

also it seems like you are rewriting:

http://apps/firstapp/CONTROLLERNAME/

to

http://apps/index.php/CONTROLLERNAME/

in your htaccess file, though I might be wrong here (use lighttpd not apache myself) ...


single system folder help - El Forum - 01-25-2010

[eluser]sasori[/eluser]
[quote author="pwfraley" date="1264446735"]Hi I am pretty new to CI,

so I might be totally of here, but did you try:

http://apps/firstapp/

or

http://apps/firstapp/CONTROLLERNAME/

or

http://apps/firstapp/CONTROLLER/FUNCTIONNAME/

also it seems like you are rewriting:

http://apps/firstapp/CONTROLLERNAME/

to

http://apps/index.php/CONTROLLERNAME/

in your htaccess file, though I might be wrong here (use lighttpd not apache myself) ...[/quote]

this works
Code:
http://apps/firstapp/index.php/CONTROLLERNAME

this doesn't
Code:
http://apps/firstapp/CONTROLLERNAME

I followed what was written from the manual about the .htaccess stuff to get
rid of the "index.php" on the url.
I even tried the allowoverride in the virtual host file
still no luck.
I just wanna get rid of the "index.php"


single system folder help - El Forum - 01-25-2010

[eluser]Joshua Logsdon[/eluser]
Did you try fiddling with $config['uri_protocol'] in your config? Maybe your PATH_INFO or REQUEST_URI aren't making it through and leaving it as AUTO picks the wrong one?


single system folder help - El Forum - 01-25-2010

[eluser]sasori[/eluser]
[quote author="Joshua Logsdon" date="1264450117"]Did you try fiddling with $config['uri_protocol'] in your config? Maybe your PATH_INFO or REQUEST_URI aren't making it through and leaving it as AUTO picks the wrong one?[/quote]

I already tried the other four constants aside from AUTO, still it doesn't work if I will only type
the
Code:
http://apps/firstapp/CONTROLLERNAME/



single system folder help - El Forum - 01-25-2010

[eluser]Joshua Logsdon[/eluser]
Hmmm, I bet you are getting tired of this Smile

Well if it works as: http://apps/firstapp/index.php/CONTROLLERNAME
and not as: http://apps/firstapp/CONTROLLERNAME
then the rewrite may not be working. Maybe you need an .htaccess in http://apps/firstapp/ with a RewriteBase of /firstapp/? It may be trying to go to http://apps/CONTROLLERNAME right now.

If that does nothing, I would break everything down... dump your $_SESSION to make sure the PATH_INFO, etc. have what you need. Enable rewrite logging in apache to make sure things are working as expected. You know it's got to be something little causing you big problems at this point.


single system folder help - El Forum - 01-25-2010

[eluser]sasori[/eluser]
[quote author="Joshua Logsdon" date="1264451163"]Hmmm, I bet you are getting tired of this Smile

Well if it works as: http://apps/firstapp/index.php/CONTROLLERNAME
and not as: http://apps/firstapp/CONTROLLERNAME
then the rewrite may not be working. Maybe you need an .htaccess in http://apps/firstapp/ with a RewriteBase of /firstapp/? It may be trying to go to http://apps/CONTROLLERNAME right now.
[/quote]

i have wasted so much time already trying to figure things out. what i did now is
i just moved the "firstapp" folder under the "htdocs" itself, ofcourse this works like,
http://firstapp/CONTROLLERNAME or just http://firstapp
but my main objective is to create a subfolder to organize all my codeigniter practice applications. coz my htdocs folder is overcrowded of other php practice folders already LOL.
Thanks for all the help sirs!!!, I'll get back to this thing someday if needed.