Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IE9 location auto + base url === redirect back to / #9501

Closed
stefanpenner opened this issue Nov 5, 2014 · 23 comments
Closed

IE9 location auto + base url === redirect back to / #9501

stefanpenner opened this issue Nov 5, 2014 · 23 comments

Comments

@stefanpenner
Copy link
Member

I believe this isn't user-error.

@jayphelps thoughts?

@rwjblue
Copy link
Member

rwjblue commented Nov 5, 2014

@stefanpenner - JSBin?

@stefanpenner
Copy link
Member Author

@rwjblue i dont know how...

@jayphelps
Copy link
Contributor

@stefanpenner Can you give a full URL example? like, http://example.com/base/#/route or what ever it is that is causes this. I don't yet follow the issue.

@stefanpenner
Copy link
Member Author

working on the repro as we speak.

@stefanpenner
Copy link
Member Author

actualy JSBIN screws this up because it adds it own URL prefix.

@jayphelps
Copy link
Contributor

@stefanpenner Just a guess, but this may be caused by the fundamental inconsistent nature of what rootURL and baseURL actually mean and also how they differ or when they're the same.

#5334

AutoLocation does not currently know anything about the <base> tag. If your URL contains a non-routable component, it needs to be set as rootURL: "/some-path/" in the router reopen.

@jayphelps
Copy link
Contributor

@stefanpenner does this happen in location: "history|hash" set by themselves? That helps me isolate.

@stefanpenner
Copy link
Member Author

it seems to work fine with hash My IE9 vm just expired... so I will have to fix that before i can continue to debug.

I will try to do that later this week.

@jayphelps
Copy link
Contributor

@stefanpenner can you give an pseudo URL so I can have some context? If it has a non-routable path portion, are you providing it as rootURL: "/some-path/"?

@stefanpenner
Copy link
Member Author

the information I am aware of:

  • the app is hosted at: /prefs/
  • baseURL: '/prefs/',
  • it doesn't have a meta base href
  • it has no routable URLs (it should really have been location: 'none' but this was forgotten)
  • its location was set to auto
  • failed on IE9 (but redirecting from /prefs/ to / but worked fine ie10+ and the rest of the history location aware browsers

@jayphelps
Copy link
Contributor

@stefanpenner Assuming you meant Router.reopen({ baseURL: '/prefs/' }); there's your issue. The router has no concept of baseURL. It's rootURL. 😃

https://github.com/emberjs/ember.js/search?utf8=%E2%9C%93&q=baseURL

@stefanpenner
Copy link
Member Author

baseURL: is specified in config/environment.js no the router.

in history mode it appears to be picked up here:

set(this, 'baseURL', jQuery('base').attr('href') || '');

@jayphelps
Copy link
Contributor

@stefanpenner Yes, but that's related. the baseURL in ember-cli is used for the <base href="{{baseURL}}. And indeed picked up by history_location, but as mentioned before, baseURL is purely for internal linking, where as rootURL is still needed if your baseURL is anything other than /. This is one part of the #5334 confusion. Just try adding Router.reopen({ rootURL: '/prefs/' }); pretty please 🌻

@jayphelps
Copy link
Contributor

baseURL is not a concept ember, the framework, has publicly. It picks this up from the <base> tag, but in an undocumented, broken manner. ember-cli builds on top of this seemingly unknowingly that it doesn't just work as one might expect since rootURL is not automatically set for you as well.

@stefanpenner
Copy link
Member Author

I think ember-cli should drop baseURL entirely and merely re-write asset urls as needed...

you are right, rootURL should be all ember cares about in this case. (and seems to work in my case)

@rwjblue
Copy link
Member

rwjblue commented Nov 5, 2014

Stef, I believe you mean <base> tag (not baseURL). We need the baseURL to be able to rewrite the assets, and know where to host the local dev server.

On Nov 5, 2014, at 4:27 PM, Stefan Penner notifications@github.com wrote:

I think ember-cli should drop baseURL entirely and merely re-write asset urls as needed...


Reply to this email directly or view it on GitHub.

@rwjblue
Copy link
Member

rwjblue commented Nov 5, 2014

Also, just an FYI, @rickharrison is working on broccoli-asset-rev to fix its handling of relative path images (the main blocker to getting rid of <base> tag).

@stefanpenner
Copy link
Member Author

we have to many concepts here... this is likely my fault, but its confusing as hell.

@rwjblue yay that sounds awesome

@teirich
Copy link

teirich commented Nov 6, 2014

I can confirm I'm also seeing this issue in IE9 browsers with a static CLI application. I am hosting an application with context root '/foo/' and when using the hash library I see requests go from 'mysite.com/foo/#/route' to 'mysite.com/#/foo/route'. rootURL is set to '/foo/' in the router as is baseURL in environment.js.

@connerfritz
Copy link

What's the status on this one? Experiencing it too.

@jayphelps
Copy link
Contributor

Can someone create a repo with an ember app I can install and reproduce?

@connerfritz
Copy link

It seems the easiest way to reproduce is adding

    <base href="/base/" />

to the index.html file of an app, then trying to access an URL in your app through it.

@rwjblue
Copy link
Member

rwjblue commented Aug 9, 2015

@stefanpenner is correct in:

I think ember-cli should drop baseURL entirely and merely re-write asset urls as needed...
you are right, rootURL should be all ember cares about in this case. (and seems to work in my case)

Agreed. I believe that this is an ember-cli issue though, not an Ember one.

@rwjblue rwjblue closed this as completed Aug 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants