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

#1
[eluser]tim1965[/eluser]
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

/var
/www
/system
/application
/static
/css

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.

Tim

#2
[eluser]rogierb[/eluser]
I would expect a structure like

-var
--www
----static
------css
--system
--application

Where your relative path would be /static/css

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

#3
[eluser]tim1965[/eluser]
Aah

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

#4
[eluser]rogierb[/eluser]
Yes correct.

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

#5
[eluser]mattpointblank[/eluser]
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.

#6
[eluser]tim1965[/eluser]
matt

i think we are saying the same thing.

Rogierb

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-2019 MyBB Group.