I cant access html files from my document root - html

I have index.html in /var/www, which is my root document directory. I also have relevantskills.html in the same directory. The first link on index.html leads me to relevantskills.html. When I go to my website at http://brianhotopp.cf/ I can see index.html, and when I click on the first link, it displays relevantskills.html. However, when I try to access relevantskills.html from http://brianhotopp.cf/relevantskills.html, It brings me to index.html. Also I cannot view images in my root document directory. For example, I have a png called favicon, but when I go to mywebsite/favicon.png, it displays the default favicon for my domain name provider, not the one I have in /var/www. Is this a problem with my configuration? My permissions? Any help is appreciated, thanks.

Your website is running inside an iframe, that's why it is not working. When you're clicking on a link, your browser is not "redirected" but the website in the iframe is. That's also why you don't see any changes in the url bar on top of your browser.
I suppose you don't want to see your website inside an iframe. If this is the case, you better contact your hosting company because this is a dirty way of hosting websites.

Related

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.

Do I need slashes before links?

When I code my website, on my local computer i can use
blablabla.
However, I also can see this type of thing on other places as
blablabla.
I am not sure what I will need when my site goes live. If I try to do this on my local computer, it doesn't understand it. My question is, if I post my site up like this, will it work?
Ok, if I have all of the files of my site in the root directory that the main index.html file is located in, will it work when it is being hosted?
If you do not use a slash, the link will point to index.html in the same folder as the page the link is on.
For example, if you have a link to index.html on the page www.example.com/page2.html then the link will take you to www.example.com/index.html. If you include a slash, it will do the same thing.
However, if the link is in a page in a subfolder, like www.example.com/projects/page2.html, then the first link will take you to www.example.com/projects/index.html while the second link will still take you to www.example.com/index.html.
The slash denotes the "web root."
Note that these are still considered "relative" links: they refer to a resource on the same server, regardless of the server's name. If your domain name changes or you upload it to another server, relative links will still work provided they have the same folder structure.

First website, only index.html page loads

I have made my first website and in the preview in Safari and Chrome from Dreamweaver it works fine. But after uploading my files with Filezilla to 000webhost and typing in the URL, only the index page loads, links to other pages on the site don't work, images are broken and the css isn't applied.
I'm think it is because I haven't named the files correctly in the code, but I have no idea what to call them in order to get it right.
The file you upload to is public_html. So I've tried http://www.webaddress/public_html/Pages/entertainment.html but it didn't change anything.
Thanks for any help!
Without code examples it's very difficult to answer this, but it's probably just that your URL format is incorrect.
For example, if you've got example.com/example/example.html and that page contains a CSS file with a location of /css/style.css, the web browser will look for example.com/css/style.css because the slash at the beginning of the URL tells it to go to the root.
In this case, your CSS file is probably actually in example.com/example/css/style.css. Remove the beginning slash so the location is css/style.css and the web browser will look for the file using the current page's location as it's starting point.

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">

static html in windows

I have a static html website in a folder on Windows XP. If I open the file directly from its location, the page loads in a browser, but none of the relative links work. They all want to be relative to localhost, not the directory they're in.
I can drop the project in IIS and it works fine, but I'd like to be able to skip that step and just browse the project without needing a server.
But my question is simply this: is there something I can do so I can view the website locally, through a browser, without a server?
Thanks.
<base> Defines the base URL or target for all relative links.
It goes in the <head> tag.
It can also be useful for developers who build websites in one location (dev) that will ultimately be placed in another location (prod).
<base href="http://myfolder/test/">
There is some discussion -- and some more examples for you -- in this SO question.