Welcome Guest, Not a member yet? Register   Sign In
New Install Images + CSS not loading/displaying please help
#1

[eluser]kreynol7[/eluser]
Help i've tried all of these paths to get my images and css to display.
I've also tried older installs of CI.
I autoloaded 'url','html'
Routes calling welcome controller which is loading index.php
ITS A SUPER NEW FRESH INSTALL, BUT THE DAMN PATHS DONT LOAD SHIT...im getting depressed, i've worked with CI before and never had any problems like this

Code:
<img src="&lt;?php echo $_SERVER['DOCUMENT_ROOT'].'ci/application/images/jake_1.jpg'; ?&gt;">
&lt;?php echo link_tag('application/css/master.css'); ?&gt;
<img src="&lt;?php echo base_url();?&gt;application/images/logo.png">
<img src="&lt;?php echo base_url();?&gt;images/logo.png">
<img src="images/jake_1.jpg" width="440" height="330">
<img src="C:/xampp/htdocs/ci/application/images/jake_1.jpg">

CODE DISPLAYED IN MY BROWSER IS
Code:
&lt;link href="http://localhost/ci/application/css/master.css" rel="stylesheet" type="text/css" /&gt;
<a href="index.html"><img src="http://localhost/ci/application/images/logo.png"></a>

MY FILE STRUCTURE IS... im using CI newest version 2.0.1
-htdocs
-ci
-application
-cache
-config
-controllers
-core
-css
-errors
-helpers
-hooks
-iepngfix
-images
-lang,libraries,logs,models,third-party
-views
.htaccess
index.html
-system

I REITERATE --- NOTHING IS DISPLAYING MY IMAGES
#2

[eluser]wh1tel1te[/eluser]
Looks like you are using .htaccess to remove index.php from the URL. Are you sure this RewriteRule is not also rewriting the paths to the images/css? Might want to double-check your Apache logs.
#3

[eluser]wh1tel1te[/eluser]
Nevermind I see your problem now. Try this:

Code:
<img src="&lt;?php echo $_SERVER['DOCUMENT_ROOT'].'application/images/jake_1.jpg'; ?&gt;">
&lt;?php echo link_tag('application/css/master.css'); ?&gt;
<img src="&lt;?php echo base_url();?&gt;../application/images/logo.png">
<img src="&lt;?php echo base_url();?&gt;../images/logo.png">
<img src="images/jake_1.jpg" width="440" height="330">
<img src="C:/xampp/htdocs/application/images/jake_1.jpg">
#4

[eluser]kreynol7[/eluser]
The .htaccess had a deny from all request in the file SO IT WAS PREVENTING MY IMAGES FROM DISPLAYING AND CSS, BUT these .htaccess files were included in the fresh install in EACH subdirectory, and now im removing them.

What security risk am i taking, its obviously they are there to prevent people from accessing the images folders etc..

BTW your solution worked thanks so much for your advice!!!
#5

[eluser]wh1tel1te[/eluser]
If you don't want people to access the images directory directly, i.e. you want to protect /application/images/, try the following .htaccess line:

Code:
Options -Indexes
#6

[eluser]kreynol7[/eluser]
THANK YOU SO MUCH!!!!!!!!!!!!!1111




Theme © iAndrew 2016 - Forum software by © MyBB