Essentially I am trying to link to my my GitHub Pages index.html file to the other files in the repository to make a multi page website.
The URL is correct, I have tried a bunch of ways and I am simply getting no where.
The main branch is called home, in it is the index.html file, as well as the other files, see below:
Main Branch is called home
The links inside the html file are:
<li class="masthead__menu-item">
Research
</li>
The file "research" is inside the home branch. I have tried naming it "research.html" I have tried deleteing the "home" from the above link so it directly links to research, see below:
<li class="masthead__menu-item">
Research
</li>
Nothing seems to work. What am I doing wrong?
After hours and hours of trying things, I finally got it to work:
<li class="masthead__menu-item">
Research
</li>
What I did was to get rid of the "home" and make the page an html file.
Thank you iamabdm and minwka!
Looking at the screenshot and the html you provided, I don't see any *.html extensions following the name of the files you're trying to link to.
For example: try renaming the file "research" to "research.html"
If the file is a html file then the problem is with the address of the URL i.e. https://xxx.github.io/research/ in Research.The last slash is causing the problem. Remove the last slash from the address, i.e. https://xxx.github.io/research and it will be Research.
Related
I assume that when I upload a repository, only one file is displayed on the site, and the other files are just sitting there in the folder, waiting to be accessed by the anchor tag. Instead, when I try to click one of the anchor tags hosted on GitHub, it leads to a 404 error. Do I have to make a repository for EACH of my .html files even if they're in the same folder? This sounds very insufficient, I believe there is another way to go about this that I don't know of.
On my main index.html file, I included anchor tags that direct the user to another section of the site with this:
Dashboard
I can already see why this doesn't work but I don't know how to fix it. So I just ended up with this:
Dashboard
I added basic-website because that was the name of my repository. Sadly, it didn't work. Any solutions?
Assuming you mean GitHub Pages and not GitHub.
If your repo is named basic-website then the URL to the top level of the repo will be https://example.github.io/basic-website/.
This means that dashboard.html will have the URL https://example.github.io/basic-website/dashboard.html.
If you link from https://example.github.io/basic-website/ to /dashboard.html then you get https://example.github.io/dashboard.html. Which is wrong. basic-website is missing.
If you link from https://example.github.io/basic-website/ to basic-website/dashboard.html then you get https://example.github.io/basic-website/dashboard.html. Which is wrong. basic-website is there too many times.
Just link to dashboard.html.
Don't put a / to go up to the root of the site.
Don't put a directory to go down into when you are already in that directory.
So i have a simple nav bar that links to other pages on the website.
<ul class="navbar__list">
<li class="navbar__item">About</li>
<li class="navbar__item">Offerings</li>
<li class="navbar__item">Testimonials</li>
<li class="navbar__item">Contact</li>
<div class="navbar__contact">
Book a session
</div>
</ul>
Which all link to html files that also exist in the root directory (the same directory). Every time i try to use the link i am getting a response that says "Cannot GET /???" with ??? being the name of the html file i am trying to access.
I have played around with the paths, tried typing the name of the file explicitly, and have found that links to external sites work just fine, it's just internal pages that are causing problems.
The pages that i'm linking to do have content in them.
I'm hosting this locally using npm live-server, i'm not too experienced in it though and do wonder if there needs to be more configuration if i'm to use it to locally host several pages?
Thanks in advance
you need to write the full path to the file, not just its name
you missed .html after file name
If it is in the same directory, then write
href="about.html"
I am new to coding and I have just signed up to ipage hosting. I have uploaded my .html files to a root directory named "Website". I have several pages that need to be linked to the index.html home page. I have written the following code for each file: Blank but this does not seem to be working. I have also tried
<li>Blank</li>
which also does not work. When I click on a link from the index.html page this message appears.
Page Not Found
The page you are looking for might have been removed, had its name changed, or is temporarily unavailable. Please try the following:
If you typed the page address in the Address bar, make sure that it is spelled correctly.
Click the Back button in your browser to try another link.
Use a search engine like Google to look for information on the Internet.
I have tried everything!! Please help!!
In some cases not only directory name is case sensitive, but might be that Website directory is your website's root directory. Therefore I would put these links to index.html and test which works:
<li>Blank</li>
<li>Blank</li>
<li>Blank</li>
It sounds like your files are all in the same folder. In that case you can just do the following:
<li>Blank</li>
Since it is in the same directory /Website/ is not needed and will break your code.
You might want to consider removing the 1st slash..
Try making your link
Blank
Also remember that directory names and files names are case sensitive
I have been working on a local website for awhile now, but I can't figure out how to link the html files I have created together so that viewers on other computers can click through them like a website.
I am building the site on my own computer, but have two other people who I want to send the files to. I can link the html pages together so they click through fine on my computer, but when I send them to the other people, the links don't work.
I imagine this is just a simple solution, but I can't seem to find it anywhere. Any help is much appreciated.
(1) Assuming you have all html files in a single folder, e.g. "somefolder" and you used
<a href="C:\somepath\somefolder\filename.html">
to reference other html files, then just replace it with a relative path:
<a href="filename.html">
(2) If you sent the pack of html pages as an archive, then it has to be extracted completely for links to work.
I think, your links are in the form C:\Users\Username\... etc. You should replace these absolute paths by relative paths.
See this answer: https://stackoverflow.com/a/22375071/2321643
I have a website and I've been searching a lot for this question and can't find anything yet.
Anyone knows how to make links take you to another folder and show the html page without page in URL? Example:
I have a html page called service.html and its on folder /service. I want a link to take me there without displaying in the URL my html file like:
click me
And it takes you to the html file and shows your content without displaying the html name in the URL. just www.example/service/ :D
Calling the file index.html instead of service.html should work, if the website is currently hosted.
You can use the method #tasteslikejava mentioned, or you can create a .htaccess in the services directory and put in the following information:
DirectoryIndex service.html
Is that what you want?
link
How to link html pages in same or different folders?