• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CSS Folder in the Application Folder

#1
[eluser]sethkain[/eluser]
I have used CI for a year or so and have done a few installs before and everything has worked fine. But I have been tasked by my new employer to set CI up to where there are multiple applications in the Applications folder. That too has worked fine.

But I am stuck with how to locate the CSS folder with multiple applications.

I used a suggestion from this page to create an asset_url() variable.
http://heybigname.com/2009/11/23/managin...deigniter/

When I do that this is what I get:
<link rel="stylesheet" type="text/css" href="http://localhost/pso/application/pso/assets/css/pso_stylesheet.css" />

My directory is setup like this:
application
->pso
-->assets
--->css
->aim
system
www

I am at the point where I have looked at this too much and I can't see what I am doing wrong.
Any suggestions would help.
Hopefully I have provided enough information, if not let me know.
Thanks in advance.

#2
[eluser]InsiteFX[/eluser]
The assets folder has to be on the same level as index.php because of the .htaccess files in the application folder and other folders.

Code:
application
assets
-- css
-- images
-- js
-- etc
system
index.php
.htaccess

<link rel="stylesheet" type="text/css" href="<?php echo base_url('assets/css/pso_stylesheet.css'); ?>" />

#3
[eluser]sethkain[/eluser]
I knew there was going to be something I left out of my problem description.

The application/pso folder contains all the files and folders that are normally in the application folder. This is so I can have multiple separate apps.

In the application/pso/config/config.php base_url() is set as http://localhost/pso/. Which is correct because my test application works fine with it set that way.

So it doesn't work to move the assets folder out on the same level as index.php (my index.php and .htaccess are actually in my www folder) because it is trying to look in the pso folder which is how my base_url() variable is set.

This is what I get when I use base_url():
Code:
<link rel="stylesheet" type="text/css" href="http://localhost/pso/assets/css/pso_stylesheet.css" />

Again that is how I want it to work, but just don't know how to get it to see the asset folder in application/pso.

#4
[eluser]InsiteFX[/eluser]
Then take a look at all the .htaccess files in the application and other folders and you will see why you cannot access them.

#5
[eluser]sethkain[/eluser]
I am going to claim ignorance in the area of .htaccess files. I have modified the one located in the WWW folder, but that is all.

The .htaccess located in the /pso folder currently says Deny from all

What do I need to change in the .htaccess file in order to have access to /pso/assets/css?

Thanks Again!

#6
[eluser]Aken[/eluser]
You should restructure your applications so that you are not intermingling logic code with static assets.

Code:
ROOT
-- pso/
---- application/
---- assets/
---- index.php
-- another_app/
---- application/
---- assets/
---- index.php

That way, the default .htaccess provided with CI will not interfere with your application functioning properly. You can then add your own .htaccess files for removing index.php in the manner you'd prefer.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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