Welcome Guest, Not a member yet? Register   Sign In
Where do you put images, styles, and scripts?
#1

[eluser]Unknown[/eluser]
I usually create a folder called content within my main (non-ci) web application that has 3 folders in it (images, styles, scripts) and keep everything there.

I can't seem to find the correct location for such a folder using CI.

I downloaded CI today, uploaded to server and ran thru the config file. Note, there was no htaccess file (not sure if I need it).

I am on a mediatemple gridserver....

I really want to get up and running ASAP...the whole point of CI but I can't get passed this issue....

Thanks!
#2

[eluser]underskor[/eluser]
For some extra security, you can move CodeIgniter's System and Application directories outside of your public_html directory. Then, put your index.php in the public_html directory along with your /content directory as you would normally. Be sure to change the paths in index.php to refer back to /System and /Application.

Code:
/
    /system
    /application
    /public_html
        index.php
        /content
            /images
            /scripts
            /styles

Code:
//index.php
//[..]
$system_folder = "../system";
//[..]
$application_folder = "../application";

Had the same problem when I started out with CI a fortnight ago, hope that helps. Smile
#3

[eluser]Unknown[/eluser]
Thanks! What I ended up doing was moving my "content" folder to the public_html directory..

/public_html
/system
index.php
/content
/images
/scripts
/styles

Thanks again!
#4

[eluser]sirfak[/eluser]
Hi I have done my project setting as per UnderSkor
/
/system
/application
/public_html
index.php
/content
/images
/scripts
/styles

and changed index file variable as said

//index.php
//[..]
$system_folder = "../system";
//[..]
$application_folder = "../application";



Now tell me what should be my base_URL and how do I link CSS/
Thanks
sirfAK
#5

[eluser]Flemming[/eluser]
Your base_url shouldn't be any different, as index.php hasn't moved.

Reference your CSS, Scripts etc with an absolute path: <script src="/content/scripts" ...

Hope that helps!
#6

[eluser]sirfak[/eluser]
Hi.
Thanks for your comments.
Things are working now!!!!!!!!
Thnks
sirfak




Theme © iAndrew 2016 - Forum software by © MyBB