![]() |
CSS, JS, IMG...? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: CSS, JS, IMG...? (/showthread.php?tid=5452) Pages:
1
2
|
CSS, JS, IMG...? - El Forum - 01-22-2008 [eluser]agartzia[/eluser] Hi there! I'm unable to access any source (css, js, imgs...) in my server. I've read a bunch of topics related but I'm still confused. Well, I'm developing an application that could be used from inside the LAN and from outside, via Internet. As you can imagine, from inside it has a different URL than from inside, so I don't know how to configure the $config['base_url'] variable. By now, it's established as "", and it works for both. In addition, we have Apache2/PHP5/MySQL5 running on a Windows server, that's because my APPPATH constant it's kind of weird, something like "D:\web\www/system/application". How can I use relative paths to my media? Or how to set it up correctly? I never thought such a tinny thing could give this headache! Thanks! CSS, JS, IMG...? - El Forum - 01-22-2008 [eluser]dawnerd[/eluser] You need to allow then in a .htaccess file. Code: RewriteCond $1 !^(index\.php|images|robots\.txt|css|swf) CSS, JS, IMG...? - El Forum - 01-22-2008 [eluser]ekeretex[/eluser] I assume since you're running windows, you aren't using an htaccess file. That right? Your assets should work with an absolute url like '/images/blah.jpg' or '/css/main.css'. Putting the base url for your outside application should work fine for your internal clients although it does require they are connected to the internet to use it. CSS, JS, IMG...? - El Forum - 01-22-2008 [eluser]dawnerd[/eluser] [quote author="ekeretex" date="1201011853"]I assume since you're running windows, you aren't using an htaccess file. That right? Your assets should work with an absolute url like '/images/blah.jpg' or '/css/main.css'. Putting the base url for your outside application should work fine for your internal clients although it does require they are connected to the internet to use it.[/quote] They are using Apache. It doesn't matter what the operating system is. .htaccess is an Apache file. CSS, JS, IMG...? - El Forum - 01-22-2008 [eluser]ekeretex[/eluser] Quote:They are using Apache. It doesn’t matter what the operating system is. .htaccess is an Apache file. Just checked , and yes you're right (although it's not enabled by default). I've never been able to get mod_rewrite to work for windows. Anyway, using the absolute path should still work. CSS, JS, IMG...? - El Forum - 01-22-2008 [eluser]dawnerd[/eluser] Really? Mod_rewrite has always worked for me. CSS, JS, IMG...? - El Forum - 01-22-2008 [eluser]agartzia[/eluser] Hey! Thanks, but it still doesn't work... If tried almost everything, such "/web/www/assets/css/style.css", or "d:\web\www\assets\css\style.css", or "d:/web/www/assets/css/style.css", or relatives... I'm not using .htaccess since I tried to remove the index.php from the URI but it won't worked (hey, it's just copy&paste;and not working??!). For the crew, I tried to read the current dir in the controller, to find out where it's running from, and it runs from the main dir (index.php, user_guide, system). Well, I tried to use a relative path from there but still is not working... Could it be the httpd.conf? Oh Lord, why You've choosen me for carry this burden??! CSS, JS, IMG...? - El Forum - 01-22-2008 [eluser]ekeretex[/eluser] have you tried '/assets/css/style.css'? CSS, JS, IMG...? - El Forum - 01-22-2008 [eluser]agartzia[/eluser] [quote author="ekeretex" date="1201013899"]have you tried '/assets/css/style.css'?[/quote] Yes, but nothing... CSS, JS, IMG...? - El Forum - 01-22-2008 [eluser]ekeretex[/eluser] How is your directory structure organized? Is the assets folder at the same level as your index.php file? |