HTML - Index html unable to access another html file in another folder - html

I have my project folder and in my project folder I have a client and server folder. In the client folder I have my main index.html file. I created another html file called products.html and access that through index.html successfully like this <a href="/products.html></a>
However, later I decided to create a html folder and store all my html files in there. When I stored my products.html file in the html folder and accessed it through index.html like this it doesnt work and instead I am getting a 404 error.
Why is the index.html file able to access the products.html file when they both are in the same folder but not when they are in separate folders?
***FOLDER STRUCTURE THAT WORKED***
project_name folder--> client folder--> index.html file & products.html
***FOLDER STRUCTURE THAT DIDNT WORK***
project_name folder --> client folder--> html folder --> product_categories --> products.html file

Assuming that your folder structure looks something like this:
.
└── html
├── index.html
└── product_categories
└── products.html
This would be the correct way to reference products.html from your index.html file:

Related

Hugo site, deployed to public/ directory in html, gives weird results

I have a Hugo site with lots of folders and subfolders, containing both _index.md files and many others. It uses the docsy theme.
Running hugo server displays the site correctly in the browser at localhost:1313
When I run hugo or hugo -D to get the same pages as HTML files on the disk, and I get
a set of folders...
... containing only index.html and index.xml files,
but no other files. All the other files are missing.
links look like the raw .md file (example: [VPAT](https://docs.axway.com/bundle/AccessibilityVPATS_allOS_en_HTML5/page/Content/accessibility.htm)
The index.html files are unstyled, unlike the pages generated by the hugo server command.
I don't see how to use the index.xml files.
Here is an example of the files and folders produced by the hugo command:
public/
index.html
index.xml
docs/
index.html
index.xml
admin_intro/
index.html
index.xml
troubleshooting/
index.html
index.xml
...
Here is what the .md file structure looks like
content/
en/
_index.html
search.md
docs/
_index.md
admin_intro/
_index.md
amdin_page_1.md
amdin_page_2.md
amdin_page_3.md
troubleshooting/
_index.md
ts_page_1.md
ts_page_2.md
ts_page_3.md
...
It looks like maybe your postcss process isn't running correctly. I had this problem after upgrading Hugo and Docsy
The postcss process isn't used in the dev mod (hugo server) but it is in production (hugo) so you will unfortunately get different results.
Try running hugo locally with the --debug flag and see if any errors show up.

hosting a github pages server with multiple html files

Im trying to host a github live server for a project that right now has a "index.html" main folder with 4 files inside that main folder named "forgot-pass.html" "home.html" "sign-in.html" "sign-up.html"
I know to host on github your html needs to be a index.html but my question is can you have a folder named index.html with html files inside that folder and it still work? or how can i host on github if i have multiple html files named various things.
Yes you can have more html files in the same folder or subfolders, but it's mandatory to have the "index.html" file. Also I think you can make that folder but will not work (I don't know if it works or not, but give it a shot).
Its required to have a "index.html" file located in the root directory. As far as having a main FOLDER named index.html with files inside of that as-well, did not work for me. but i did not try to have a index.html file in the root directory on its own ALONG with a separate folder containing the rest of the html files. So i don't know if that works or not. i just put all the html files in the root directory and made sure to have one named "index.html"

How to access previous directory in html

I have index.html file in "WTProject" Folder. I've created 404.html in "404" Folder which is in "WTProject". It simply go to 404.html from index.html.
but I don't know how to go back to WTProject Folder to access index.html.
I mean what should I write in Home so that it will go in previous directory and open index.html.
You can use ../ to access previous directory in HTML. For usage check out: https://www.w3schools.com/html/html_filepaths.asp

I can't edit Jekyll index.html

I'm trying to change /_site/about in index.html. When I edit the index.html and start jekyll, index.html back to it's original content.
Sorry for my english.Thank you very much for your help.
You don't edit files inside the /_site directory. When jekyll builds the site, it overwrites any and all files in that directory.
Edit the index.html file in the /about/ directory outside of the /_site/ folder.
Run the command jekyll build to apply these changes to the generated site.
Or use jekyll serve to automatically host the content locally and update the content when a change is made.
There's no need to edit Index.html file as it is generated from the markdown file your provided which as we all know is called index.md, whenever you change that file and run jekyll build it re-generates the index.html file hence if you edit once you would have to do the same again when you change index.md file.
So directly write html / markdown in index.md file in your jekyll directory.
Best,
Daksh

Website doesn't display after uploading the Yeoman created site

I am using Yeoman to create a static website, which created a file structure like:
-app
index.html
-css
style.css
-js
script.js
Gruntfile.js
README.md
bower.json
package.json
I used filezilla to send this to my server (using bluehost) but nothing seems to be displaying? when I try to hit the website. (ex. whatever.com)
Is it because my 'index.html' lives inside the app directory? Should I only host my app diretory so 'index.html' is in the root directory?
I think you are on the right track with location of index.html but not quite. Your file structure should look like:
[document root]
index.html
- css (a directory of the root)
style.css
- js (also a directory of the root same as css)
script.js
Gruntfile.js
README.md
bower.json
package.json
Note in the above structure, there is no -app folder. You can test the above by using your web browser and pointing to http://yoursite.domain/app and see if that displays.
If that does not solve the issue, then you may be uploading to somewhere outside of the document root for your web server in which case you should find out where that is. Best place to ask about that would be on either https://serverfault.com/ or on https://superuser.com/. Good luck.