Welcome Guest, Not a member yet? Register   Sign In
Weird routing problem for bootstrap assets in IE8
#1

[eluser]bill19[/eluser]
Hi everyone,

I am trying to implement the bootstrap form at https://github.com/jackilyn/bootstrap-contact/ into my site. after integration it works fine in chrome, IE9 and firefox , but in IE8 , I am getting:

Quote: Couldn't load http://localhost/my_project/index.php/my...reset.less (404

Using chrome developer tools ( it is working in chrome ) , under the network tab I see that the directory for reset.less is
Quote:localhost/my_project/assets/less
not
Quote:localhost/my_project/index.php/my_controller/assets/less/

I am concerned that there is some strange routing problem involving CI and IE8. Can anyone offer me advice on how to fix this?

Thanks,

KC
#2

[eluser]CroNiX[/eluser]
It sounds like you are using site_url() instead of base_url() for creating the url to your asset. site_url() automatically adds index.php if index.php has not been removed via the config and htaccess.

site_url() will return your $config['base_url'] setting + $config['index'], so if $config['index'] = 'index.php', that's where it's coming from.
base_url() will return the base_url by itself (http://yoursite.com/ or whatever you have it set to)



#3

[eluser]bill19[/eluser]
Thanks for looking at it croNiX,

I am using
Code:
<base href="<?=base_url();?>">

Code:
<!doctype html>
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" c charset=utf-8" /&gt;
&lt;base href="&lt;?=base_url();?&gt;"&gt;
&lt;title&gt;Bootstrap Contact Form&lt;/title&gt;

&lt;link rel="stylesheet/less" type="text/css" href="assets/less/bootstrap.less"&gt;

[removed][removed]
[removed][removed]
[removed][removed]

&lt;/head&gt;

and again if this was the case why would it work in the other 3 browsers?

KC
#4

[eluser]CroNiX[/eluser]
What's your $config['base_url'] set to?

It looks like it should be 'http://localhost/my_project/'

What is $config['index_page'] set to?
#5

[eluser]CroNiX[/eluser]
Also, are you using an htaccess file? If so please post it.
#6

[eluser]bill19[/eluser]

Quote:$config['index_page'] = 'index.php';

no .htaccess file.

Quote:$config['base_url'] = '';

Thanks,

KC
#7

[eluser]CroNiX[/eluser]
Try explicitly setting your base_url like I showed. Right now it's guessing (since it's empty), and it might be getting it wrong.
#8

[eluser]bill19[/eluser]
Hi CroNiX,

I followed your directions, and I have a clarification. I realized that the browser ( which is IE8 ) is set on Document mode IE7 standards. When I set Document mode IE8 standards it works normally. ( you go to tools->developer tools to do this in IE8 ).

So I may need to investigate more on CI, IE7 and bootstrap, unless you are aware of any specific issues or fixes.

Thanks,

KC




Theme © iAndrew 2016 - Forum software by © MyBB