简体   繁体   中英

How do I put my index.html in the same folder as my other .html files on github?

So I just started web development an began building my portfolio. Although most of my content is on the same page and most links redirect to different websites, I do have one link that redirects to a different page of my website. So the content changes but the navigation bar is still there.

However, the files can't be found when I load my website. Can someone clearly tell me how to put all my files in the same folder on Github? I believe you have to redirect the index.html into a new folder with the other HTML files. What exact info should I put in my original index.html file (outside of folder) so it redirects correctly? And is there anything I need to do with .css?

Thanks in advance.

You can achieve this with a simple JS call

<script type='text/javascript'>
  window.location.href = 'path/to/your/page.html';
</script>

This can be the only content inside your new index.html but it is required to have an index page for the web client to recognize.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM