CodeIgniter Forums
hi guys, need some help going on production - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: hi guys, need some help going on production (/showthread.php?tid=67114)



hi guys, need some help going on production - maorz99 - 01-17-2017

hi guys, 
hope you could help me out..
so i build a simple ci project and i'm moving it from the local host to my web host.
now i don't want to put all the project public right(public_html)?
so put it on the server as follows:

root:
--ci
   |-application
   |-assets
   |-system

--public_html
   |-index.php

i configured the index.php application and system folders.
but for some reason my css and scripts won't work
is there any way to link  my css and scripts without putting them on public?


RE: hi guys, need some help going on production - InsiteFX - 01-17-2017

You should leave your assets folder inside the public_html folder.


RE: hi guys, need some help going on production - maorz99 - 01-17-2017

(01-17-2017, 11:10 AM)InsiteFX Wrote: You should leave your assets folder inside the public_html folder.

hi,
thanks for your reply, i read it elsewhere that i should keep it public
but what is the reason for that?


RE: hi guys, need some help going on production - maorz99 - 01-23-2017

guys please, anyone knows if theres is a different way? and if not how can i block access from other people to get into my assets folder than?


RE: hi guys, need some help going on production - Diederik - 01-23-2017

You should not want to. Normaly you would put images, javascript, css, font files etc into your assets folder. Those files need to be accessable to a browser in order to do their work. You should avoid plaviong php files in your assets folder.


RE: hi guys, need some help going on production - ivantcholakov - 01-23-2017

(01-17-2017, 12:16 PM)maorz99 Wrote:
(01-17-2017, 11:10 AM)InsiteFX Wrote: You should leave your assets folder inside the public_html folder.

hi,
thanks for your reply, i read it elsewhere that i should keep it public
but what is the reason for that?

@maorz99

assets/ contains css, images, js, fonts, ... the visual design, right? So, these resources should be accessible by the browser, and this should not depend on whether a user has been logged in your system. This is the fastest way for output.

If there are some user uploaded resources (not the visual design, images, video, ...) and if you want to manage access to them, then, these selected resources should be put within a non-accessible by the browser directory. Additional PHP script with access control should output the requested resources. Some rules for appropriate links probably would be needed. And performance would suffer, because the PHP engine is to deal with these images, etc. too.

Yes, theoretically, you can put all your design and user uploaded resources within the database if yo wish, but what is the point?

Move assets/directory at the public place. Of course, its directory structure should not be seen through the browser, check Apache settings or .htaccess for this this (Options -Indexes).