如何引导网站主机访问文件夹内的`index.html` [英] how to direct website host to access `index.html` inside a folder

查看:37
本文介绍了如何引导网站主机访问文件夹内的`index.html`的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我托管了我的网站,但我的 index.html 文件在一个文件夹中,所以每次我搜索我的域时,我都必须浏览文件目录并打开 index.html 文件以访问网站.有什么方法可以将域直接指向主机内部的 index.html,或者唯一的方法是在托管时将 index.html 文件放在文件夹外,如果是这种情况然后我将不得不在我的基本代码中更改所有直接指向索引文件的 url.

So I hosted my website but my index.html file is inside a folder so every time i search my domain i have to navigate through the file directory and open the index.html file to get access of the website. Is there any way to direct the domain to index.html directly inside the host, or the only way to do that is to have the index.html file outside the folder when hosting cause if that is the case then i'm going to have to change all the url's that direct to the index file in my base code.

推荐答案

这个问题有很多解决方案.但它们都取决于您的托管情况.如果您不控制服务器,那么这将使您的网站按原样运行.

There's a lot of solutions to this problem. But they all depend on your hosting situation. If you aren't controlling your server then this would make your website work as is.

在根文件夹中放入一个 index.html使用包含元重定向的准系统 HTML 文件

Put an index.html inside the root folder With a barebones HTML file that contains a metaredirect

<meta http-equiv="refresh" content="0;url=/folder_that_has_homepage" />

老实说,我可能只是做一个查找和替换来修复你的路径.

Honestly, I would probably just do a find and replace to fix your paths though.

这篇关于如何引导网站主机访问文件夹内的`index.html`的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆