We help IT Professionals succeed at work.

IE is demanding full direct links.. Turns others into http:///?var=example. FF/S/O are fine. Why?

Last Modified: 2013-11-19
In Firefox / Opera / Safari it all works fine. In IE it goes haywire.

I'm making a site with PHP 5, Smarty, Javascript, HTML.

I'm running it on MAMP right now for testing. When I connect to it from my PC and use PC Firefox or Safari, I see it fine. When I look at it through IE, all the links are errors.. none of the CSS links up..

A link would be... a href="index.php?var=example"

In FF/S/O , it pulls the whole thing: http://localhost/site/index.php?var=example
In IE: It just pulls http:///index.php?var=example.

Notice in IE it has 3 slashes for some reason.

This is clearly why none of the javascript or CSS is linking up, but why is the IE demanding full links??

I removed the Doctype and everything to test that, but that wasn't the issue.

Other sites on this MAMP server I look at with IE are fine. It just seems to be this one in particular for some reason.

Any Ideas?
Watch Question

Top Expert 2007
Unlock this solution and get a sample of our free trial.
(No credit card required)

Can you post your code?
At least the part that is giving trouble.

IE, FIREFOX and OPERA all do stuff differently and read HTML differently.

And using full path is not a good idea when making a site, cause if anything changes, then you have to go through your whole site and fix every link.

If you look at the source of the big boys, Microsoft, HP, Google, EE, they use relative path. You only use full path when leaving the domain.


I would only use a full path if I were forcing a HTTPS or something similar obviously.

I can't really post the code. It's a very extensive site and I can't just nail the problem to a certain location or I would have solved it ;)

It's strange. Here's something else:

When I just let Smarty display the website, on PC IE7.0 & IE6.0 it failed.
When I echoed like.. "<div>&nbsp;</div>" THEN displayed Smarty, PC IE7.0 showed it fine. IE6.0 still failed though.

Its very strange.

I tried multiple doctypes in case that was the issue and it seems to be fine. All the head, body, etc tags are in there fine.

IS this site publicly accessible?

Can you post say the portion that generates the links, or at least the result of the generated link,
Ex. go to the page, go view source then paste the result here?


It's not accessible. It's on my local test server where every other site works fine.

The generated links are like this

<a href="index.php?var=example">Content</a>


And instead of making it


They appear as


No other sites have had this happen. I've never even seen this before.

We can't help unless we see the code that is generating these links.

This <a href="index.php?var=example">Content</a>

Cannot produce


there are 3 /// in the above, browsers only attrib http:// to the front of a link that doesn't have it. so something is placing that extra / in the code. That tells the browser that it's not a relative path but a full path.


I know. I'm not trying to sound rude but I've been doing this for 15 years. I've gone over the basics.

The reason I'm asking on this forum is because there is nothing generating the links other than Smarty. The template files have just the simple link above, Smarty just displays it. Shouldn't be causing an error.

Nothing generates the link which is why it's so confusing why I get http:///

Its like it's trying to do file:/// but using http instead. I'm pretty lost on this one.

So can I see the smarty code that makes that link?

I don't want to be rude either, but as I have said to others in the past, posting code is better then speculation.

If you don't post some code that I can analyze, I can't help. Unless it's a black and white answer.
In this case either there's a typo somewhere, and having a second pair of eye's read your work is always better then you rereading it over and over, or there is a mistake, but I can't help unless you help me.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.