• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
relative paths

Apologies for this, i know its relatively easy but i am having a bad day.

I have just moved both my system and application folder out of /var/www/

so dir structure looks like this


I have been using relative paths
with base_url()../system/static/css
base_url = www.something.com/
(index.php removed)

so my question is what should i use now, are they relative to their location or to var/www/

Thanks in advance.


I would expect a structure like


Where your relative path would be /static/css

You cannot reference the static/css directory if it is not in your webroot.


Ok this is my first time with this structure, so aplogoies for any stupid questions. Is it only the system and application directory that can be above root and everything else(i.e. cdd,javascript, static web site images, user photo upload directory) must sit under /var/www.

Thanks in advance

Yes correct.

Moving things out of your webroot makes it inaccessable through the webserver.

Personally I make an 'assets' folder inside the CI install root (eg in the same directory as index.php) and put folders for /css/ or /js/ or /img/ in there. Then everything can be references with base_url() . 'assets/img/logo.jpg' etc.


i think we are saying the same thing.


I now have CI install and application sitting under var/system. Everything else is sitting under var/www which for me is CSS, Javascript, my static images for website, and a photo upload area for users. It looks to be working ok, i am going to test for the next few days.
Many thanks to both of you for your help.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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