How to bring images folder out from CI Architecture. |
[eluser]Arun Joshi[/eluser]
Hi, Am a beginner in CI, I have completed my site's some pages in CI, But now me facing a problem with image path. I am using wamp server and this is my site folder. Code: E:\wamp\www\technoneeds am accessing site by this url (my base url) Code: http://localhost/technoneeds/ I have added some imgages in the following folder. Code: E:\wamp\www\technoneeds\system\application\images I want to display an image say 'pic1.jpg' in the above folder in posts controller, ie (http://localhost/technoneeds/posts/). How can I set the path in img tag. I dont like to add a path like 'system\application\images' in img tag. How can I set a image path like this Code: http://localhost/technoneeds/images/pic1.jpg This is my current .htaccess file. Code: <IfModule mod_rewrite.c>
[eluser]Dam1an[/eluser]
You can either use the img function in the http://ellislab.com/codeigniter/user-gui...TML helper or use the base_url function to give your images an absolute path
[eluser]Arun Joshi[/eluser]
I have tried both methods, The image path is 'http://localhost/technoneeds/imgs/josh.jpg', but the image is not showing there, I think It is redirected by .htaccess file. How can I rewrite it?
[eluser]Dam1an[/eluser]
This is my htaccess Code: DirectoryIndex index.php The first rewrite condition means anything that isn't index.php, the image directory etc, so add a similar line to yours
[eluser]Arun Joshi[/eluser]
Thanks Dam1an, Your .htaccess file solved my problem. Thank u verrrrrrrrry much.... :coolsmile:
[eluser]Dam1an[/eluser]
you're welcome (although my htaccess was based on Daniels killer htaccess lol) |
Welcome Guest, Not a member yet? Register Sign In |