Welcome Guest, Not a member yet? Register   Sign In
Image display and .htaccess
#1

[eluser]julian0008[/eluser]
Here is my line of code below which displays an image from the uploads folder within the application folder using base_url()
Code:
<div id = "picture">
  <img id = "main" src = "&lt;? echo base_url() . 'application/uploads/default.jpg'; ?&gt;" alt = "profilepic"/>
</div>

And this is my htaccess file located at the root directory of my CI installation

Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /tutorial/

    # Checks to see if the user is attempting to access a valid file,
    # such as an image or css document, if this isn't true it sends the
    # request to index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
    ErrorDocument 404 /index.php
</IfModule>

The problem is the image does not display. Instead, it displays the alt text. Is there something wrong with my htaccess? Did I miss something? Thanks for any help in advance!


Messages In This Thread
Image display and .htaccess - by El Forum - 03-07-2013, 07:58 PM
Image display and .htaccess - by El Forum - 03-07-2013, 09:33 PM
Image display and .htaccess - by El Forum - 03-08-2013, 06:27 AM



Theme © iAndrew 2016 - Forum software by © MyBB