promises-aplus / promises-spec

An open standard for sound, interoperable JavaScript promises—by implementers, for implementers.
https://promisesaplus.com/
Creative Commons Zero v1.0 Universal
1.84k stars 164 forks source link

Old GitHub site should redirect to site at promisesaplus.com domain. #153

Closed tadman closed 10 years ago

tadman commented 10 years ago

The old GitHub pages site http://promises-aplus.github.io/promises-spec/ ranks really high in the Google search results for Promises/A+ but is apparently out of date and very few of the links in the footer work correctly. Since it looks exactly like the new site, it does stand to introduce a lot of confusion.

It seems like this page should be killed off and replaced with some kind of redirect to the official http://promisesaplus.com/ site.

domenic commented 10 years ago

Do you know how to do that? I have thought about this problem a lot and am not sure it is possible.

tadman commented 10 years ago

I'm not sure who's in charge of the repo for that site, but it should be the promises-aplus project which doesn't appear to be public. Making patches to that repo will trigger a site rebuild.

domenic commented 10 years ago

Both sites are a product of this repo's gh-pages branch. But how do we tell GitHub to create different contents for the different URLs?

tadman commented 10 years ago

It'd probably be better to have two different repos, one for the domain, one for the legacy site, and make the legacy site a redirect to the main site.

The pages site on the github.io domain is locked to the repo name, but the repo for the domain name one could be called anything.

domenic commented 10 years ago

One hacky solution would be a script like this at the bottom:

<script>
  if (document.location.host !== "promisesaplus.com") {
    // redirect to corresponding site on promisesaplus.com, possibly overwriting the
    // body with a message beforehand so people are aware of the issue.
  }
</script>

I'd much prefer a proper 301 redirect, but I don't see any way we're going to get that from a GitHub pages site.

I was tempted to try this until gh-pages broke entirely for me. #158

briancavalier commented 10 years ago

Maybe one of the approaches from this SO can help.

helmus commented 10 years ago

So is anyone going to add that meta header? According to that stack overflow answer it seems like a pretty perfect solution. EDIT: I'm just realizing right now that that will probably not work because the redirect will be circular.

What about adding a base tag ? <base href="http://promisesaplus.com/" >

It's not perfect but I think it's better then dead links or absolute paths.

domenic commented 10 years ago

Fixed by a series of fairly-comical commits in the gh-pages branch. Also added rel="canonical" links which should help clean up our Google presence.