I posted this question about a month ago regarding custom domains with Github Pages. I've since gotten everything set up and working correctly for both user/organization pages, as well as project pages.
My question this time is this: now that I have project page correctly set up to be available at both www.domain.com/project/
and project.domain.com
is there a way to redirect users who may visit "sub-directory" to the more desirable "sub-domain" URL?
I spoke with GitHub support and they said that I could accomplish this redirect with javascript, but didn't offer any further information. They obviously don't allow .htaccess
files or any other type of server-side redirects. Anyone have any ideas?
EDIT: I'm aware that this should be done with window.location.replace();
so what I really need to know is where in the repo this snippet should go.