Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Relative redirect using meta http-equiv="refresh" with gh-pages

So i am trying to use the redirect meta tag on a web app hosted on Githubs gh-pages.

This is the tag I'm using; which works well on the local dev machine

<meta http-equiv="refresh" content="0; url=/angular/?layout=4#/app/home" /> <!--redirect-->

The problem is that gh-pages sites live on a URL like this

https://github.com/username/reponame

Which means that my redirect doesnt work because it drops the reponame for this:

https://github.com/username/angular/?layout=4#/app/home

obviously I could hardcode the repo name in the redirect tag but then this would mean that it wont work when im developing locally because the URL in the local dev doesnt include the repo name.

How should my meta tag be set up for this to work locally and on gh-pages

like image 850
rex Avatar asked Jun 10 '16 15:06

rex


1 Answers

You can use a relative url like ./angular/?layout=4#/app/home.

Your redirect now reads :

<meta http-equiv="refresh" content="0; url=./angular/?layout=4#/app/home" />
like image 77
David Jacquel Avatar answered Sep 28 '22 10:09

David Jacquel