Reputation:
The location at which my site ACTUALLY works: https://username.github.io/html/
The location at which I want my site to ACTUALLY work: http://username.github.io
Initially, I had my index.html directly in my repository, but then I moved it into an html folder with all my other html files for organization. How do I make it so it works in the following manner:
<head>
<title> NAME </title>
<meta name="viewport" content="width=device-width">
<link rel="shortcut icon" type="image/ico" href="/favicon.ico">
<link rel="stylesheet" href="../css/index.css">
</head>
<section id="Site">
<h3>
<a href="../html/">FIRST LAST </a>
</h3>
</section>
The location at which I want my site to ACTUALLY work: http://username.github.io
Thanks
Upvotes: 3
Views: 1431
Reputation: 1884
Apparently, as you can read on github pages doc, you cannot configure it for having the "main page" on another place who aren't the root of repository, or a folder called docs.
As a workaround, you can try some options:
You can try to put an index.htm on the root of the repository, and do a redirect from it. Check this code:
<meta http-equiv="refresh" content="0; url=http://example.com/" />
If you need more information about how to do a redirect on html, check this question on SO: Redirect from an HTML page. But think, the redirect will only work for each file you create (for example, index.htm). And they only can have one destination. This option will not allow you to redirect any request to the page to the /html/ folder.
Upvotes: 1
Reputation: 112
You need to use the relative path to your index.html. So you'd have
<a href="../html/index.html">FIRST LAST</a>
Upvotes: 0