![]() |
file paths are wrong - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: file paths are wrong (/showthread.php?tid=31312) Pages:
1
2
|
file paths are wrong - El Forum - 06-15-2010 [eluser]GamingFusion[/eluser] ok heres what i got Code: <IfModule mod_rewrite.c> and heres my link to an image Code: <a href="#"><img src="<?php echo base_url();?>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 file paths are wrong - El Forum - 06-15-2010 [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? file paths are wrong - El Forum - 06-15-2010 [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. file paths are wrong - El Forum - 06-15-2010 [eluser]Slowcheetah[/eluser] Did you check the permission rights of the file? file paths are wrong - El Forum - 06-15-2010 [eluser]GamingFusion[/eluser] im currently running it on a local server file paths are wrong - El Forum - 06-15-2010 [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? file paths are wrong - El Forum - 06-15-2010 [eluser]GamingFusion[/eluser] mac or apple file paths are wrong - El Forum - 06-15-2010 [eluser]Slowcheetah[/eluser] http://brockwoolf.com/blog/change-file-permissions-using-terminal-in-mac-os-x file paths are wrong - El Forum - 06-15-2010 [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 file paths are wrong - El Forum - 06-15-2010 [eluser]GamingFusion[/eluser] moving it the location of index.php worked |