• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
hi guys, need some help going on production

#1
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?
Reply

#2
You should leave your assets folder inside the public_html folder.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply

#3
(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?
Reply

#4
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?
Reply

#5
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.
Reply

#6
Smile 
(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).
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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