Welcome Guest, Not a member yet? Register   Sign In
file paths are wrong
#11

[eluser]GamingFusion[/eluser]
ok heres what i got
Code:
<IfModule mod_rewrite.c>
    # activate URL rewriting
    RewriteEngine On

    # do not rewrite links to website assets
    RewriteCond $1 !^assets

    # do not rewrite for php files in the document root or robots.txt
    RewriteCond $1 !^([^\..]+\.php|robot\.txt)

    # do not rewrite requests for the standard asset files
    RewriteCond $1 !\.(css|js|png|jpg|gif|zip|gz|htc)$

    # but rewrite everything else
    RewriteRule ^(.*)$ index.php/$1 [L]

</IfModule>

<IfModule !mod_rewrite.c>
    # If we don't have mod_rewrite installed, all 404's
    # can be sent to index.php, and everything works as normal.

    ErrorDocument 404 /index.php

</IfModule>

and heres my link to an image

Code:
<a href="#"><img src="&lt;?php echo base_url();?&gt;assets/images/logo.png" alt="logo" border="0"/></a>

and the image doesnt load, when i copy the image location and open it in another tab and i get a 404 page but not the CI 404
#12

[eluser]WanWizard[/eluser]
If you get a standard 404 page, that means that
a) your rewrite condition works
b) the file does not exist or can not be loaded

When you get the properties of the image in your browser, what is the src pointing to? Do you have your site's base url defined in the config file?

If the path to the image is correct, does the image exist (and if on Linux, is the case correct?) Does the webserver has the right to read the image?
#13

[eluser]GamingFusion[/eluser]
the file exist because i go to the file location in the browser(file:///Users/Username/Sites/socialcrab/system/appication/views/socialcrab/assets/images/logo.png) and it comes up but i even tried putting that as the file location in the code and it wont load.
#14

[eluser]Slowcheetah[/eluser]
Did you check the permission rights of the file?
#15

[eluser]GamingFusion[/eluser]
im currently running it on a local server
#16

[eluser]Slowcheetah[/eluser]
[quote author="GamingFusion" date="1276631593"]im currently running it on a local server[/quote]

Local server also have permissions.. Do you work on windows? or apple? or *nix?
#17

[eluser]GamingFusion[/eluser]
mac or apple
#18

[eluser]Slowcheetah[/eluser]
http://brockwoolf.com/blog/change-file-p...n-mac-os-x
#19

[eluser]danmontgomery[/eluser]
[quote author="GamingFusion" date="1276630116"]the file exist because i go to the file location in the browser(file:///Users/Username/Sites/socialcrab/system/appication/views/socialcrab/assets/images/logo.png) and it comes up but i even tried putting that as the file location in the code and it wont load.[/quote]

base_url() is the location of index.php, in this case I'm guessing /users/username/sites/socialcrab. /users/username/sites/socialcrab/assets/images/logo.png is not the path you have pasted above... So no, it doesn't exist.

My suggestion is to move assets to the same location as index.php, so your assets will always be in the same place relative to the url.

I'm also partial to the traditional "only rewrite if the path doesn't exist" htaccess:

Code:
# Turn on URL rewriting
RewriteEngine On

# Put your installation directory here:
RewriteBase /

# Don't rewrite valid paths
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Rewrite all other URLs to index.php/URL
RewriteRule ^(.*)$ index.php/$1 [PT,L]
#20

[eluser]GamingFusion[/eluser]
moving it the location of index.php worked




Theme © iAndrew 2016 - Forum software by © MyBB