Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 2
Message 1 of 9

SOLVED: Internal links not working properly

Solved! Go to Solution.

So I am kinda new to html and github. I have my github pages website up and running, but when you click on a link in the nav bar, it shows a 404 error because the link repeats itself. Example: Normal url upon loading up the site is example.github.io/example.html/. When you click on a link in the nav bar it goes to example.github.io/example.html/example.html, and that shows a 404 error. 

 

Link to main repository --> https://github.com/ninetailedmachine/ninetailedmachine.github.io

 

EDIT: I've solved the problem

8 Replies
Highlighted
Community Manager
Message 2 of 9

Re: SOLVED: Internal links not working properly

@ninetailedmachine Thanks for the update! Would you mind sharing your solution?


My very best,
Andrea

Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!

Highlighted
Solution
Copilot Lvl 2
Message 3 of 9

Re: SOLVED: Internal links not working properly

I had made separate repositories instead of making a folder inside of the main repository. So I made a folder in the main repo, changed the html a bit to follow that path, deleted the other repositories and it worked! Obviously, I'm new to github, so this took me longer to figure out.

Highlighted
Community Manager
Message 4 of 9

Re: SOLVED: Internal links not working properly

@ninetailedmachineThanks a bunch for coming back to share! We're looking forward to seeing you around!


My very best,
Andrea

Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!

Highlighted
Copilot Lvl 3
Message 5 of 9

Re: SOLVED: Internal links not working properly

You can also use JS in the end to force it to go to that link.

 

<a href="example.html" onclick="window.open('example.html', '_self');">

  Example

</a>

Highlighted
Ground Controller Lvl 1
Message 6 of 9

Re: SOLVED: Internal links not working properly

thanks that is exacatly what i was looking for.

Highlighted
Ground Controller Lvl 2
Message 7 of 9

Re: SOLVED: Internal links not working properly

How could I use your example above and apply it to this? : 
 
<a href="Services.html">Services</a>
Highlighted
Ground Controller Lvl 1
Message 8 of 9

Re: SOLVED: Internal links not working properly

Hi How do you solve the problem can you tell me some details.

do i have to create a forlder within repo and upload files into that folder?

 

 

My Repo-> https://github.com/mzaifquraishi/mzaifquraishi.github.io 

Highlighted
Copilot Lvl 3
Message 9 of 9

Re: SOLVED: Internal links not working properly

Your website looks great so far!

GitHub Links don't work unless forced via JS.

 

<a href="example.html" onclick="window.open('example.html', '_self');">

  Example

</a>

 

Change example.html to your page and change the Example text to your link text.