Issue with uploading website successfully to GitHub Pages - html

I'm having an issue with uploading my website to GitHub pages. I am a beginner and have just made my first website that uses several html files. I have created a repository for this website. The website contains index.html, and 2 other html files. When I first open the website through GitHub Pages it appears to be fine, however if I click on a link on the website which takes me to the main page (the main page being index.html) it opens up a completely different website from my other repository. I realised this is because it uses the same url (username.github.io/index.html) as my other repository. Since both of these are the same I guess it just opens up my other website because it was created earlier.
This is my first issue. I also have another issue. My other 2 html files have a unique html file name, but when I open the link for them I get a 404 error:
"The site configured at this address does not contain the requested file."
From what I understand, a GitHub Pages URL would look like this:
username.github.io/repository name/html file name.
My website looks fine when I open it with this URL:
username.github.io/repository name
However, when I click on any link on the website the URL loses it's repository name and changes into:
username.github.io/html file name which brings up a 404 error.
I don't understand why it does that.

The URLs in your links start with /, which points at the root of the domain.
Don't do that.

Related

Browser shows contents of index.html instead of the actual website

I just created my portfolio website which I made with bootstrap studio 2 and made some edits to the file once I exported it. When I load my site on my local host it loads just fine. But after I uploaded it via ftp (filezilla) the page does not fully load only the html and the bootstrap css. Has anyone ever experienced this and is there a solution?
Here's what it looks like on the web host:
Here's what it looks like on localhost:
You're viewing the page through the file manager, so it just outputs the file content. You need to visit your index page through given (by your hosting) domain name (like yourdomain.hobohost.com/index.html).

jekyll won't render on github-pages of project site

I want to set up 2 different jekyll sites:
https://github.com/Caruso33/caruso33.github.io for my front page to the redirected domain leinss.eu and
https://github.com/Caruso33/traveltobi.de for blog related stuff, to the subdomain blog.leinss.eu (traveltobi.de also points to that).
The user page is rendered all fine, but the project site (traveltobi.de) doesn't work. I set the gh-pages settings to the master/docs branch and put all jekyll related files in this folder github.com/Caruso33/traveltobi.de/docs. However, I only can see the basic HTML page.
Is there a wrong setup in the _config.yml?
CNAME is showed as it should.
I don't know what configuration to change properly.

failed to load resource hexo.js

I'm using HexoJS to create a blog. I was able to generate the static files using hexo generate. Even though there are css files and JS files generated, they are not properly linked to the index.html.
So, I have to open each html page and correct each page links given in href and src attributes one by one. I believe that this is not very practical. Can anyone help ?
The localhost is used for preview the website. When we publish our blog, it should be on a server, then the path will be interpreted correctly, we don't need to change any thing. What we saw on http://localhost:4000 will be same when you published your website.
So, we don't have to worry about the broken paths in the public folder.

HTML-Reloading web page takes me to main page

I am creating a website and hosting it myself via IIS. I am trying to traverse pages but it's not really working.
This is my code that will go to my "serivices" page. However, when on this page the URL does not change and when pressing reload I am taking back to the home page.
Our Services
So, for example, since my page is www.aasoftwaresolutions.com, when I click "Our Services" it should take me to www.aasoftwaresolutions.com/services.html. It doesn't do this. It will show the webpage but it will still have URL www.aasoftwaresolutions.com and when I press reload on the browser it takes me to the homepage rather than keeping me on services.
Here's my file structure:
F:\Website\ (base directory for website)
F:\Website\html\ (where all the HTML is)
Any ideas?
start directory:
it's for example: index.html
Our Services
the directory is here (for example).
F:\Website\ (base directory for website) \index.html
with this you are going to:
F:\Website(base directory for website)\html\services.html
with this ..\ stand back a folder ago.

How do I make a hyperlink go to a page on another website?

When creating the html files for my website, I had no problem understanding how to create links so that users could navigate between pages. For example, this worked fine to send someone to the about page:
ABOUT
I'm having issues upon uploading the html files to my web server.
How, do I get About link to send the user to: www.blahblahblah.com/about ?
My landing page has been renamed index.html.
You need to add http:// in the href to go to a page on an external site:
About page on blahblahblah.com
This is because when you simply link to it without the http:// in front (hyper text transfer protocol) it is trying to go to the page "www.blahblahblah.com" which obviously does not eixst on your server. When you add the http://, the browser knows that it is another website and therefore will bring you to the external site.
Your web server will be configured with a "document root" directory. Usually this is the directory where index.html is located. Place your about.html in the same directory, and the link you provided will link to it if it is served from the same URL-path (that is to say, it's not in a sub-folder). If your files are indeed in the document root, you may prefix your link href attributes with a forward-slash, which indicates that the path is relative to the document root.
As noted in the previous comment, this technique only works for pages hosted in the same directory as each other, on the same host. If the files are in different directories, you must start with the slash, and if they are on different hosts, you must include the full domain and path.
This is what he meant:
<input type="button" value="SampleText" onClick="window.location='http://www.blahblahblah.com/about';">
and this will open it in a new window:
<input type="button" value="SampleText" onclick="window.location='http://www.blahblahblah.com/about';" target="_blank">