Index.html 打开网站时未访问

Index.html not accessed when opening website

我有一个网站,norway-yv.epizy.com。我使用 InfinityFree 来托管(我只是想将该网站用于练习和作为一个有趣的爱好项目)。他们使用 filemanager.ai 来管理我的文件。我有一个庞大的文件和文件夹系统(见下文),而不必上传我创建的每个文件和每个文件夹,这样一切都在网站文件夹中。这样,我不需要每次在我的本地网站副本中更改某些内容时都上传所有内容。我希望 norway-yv.epizy.com 重定向到 norway-yv.epizy.com/website/home.html,并已通过 index.html 文件完成此操作。但是,它只给出错误 404.

我的文件

.htaccess

DirectoryIndex index.php index.html index.htm index2.html

ErrorDocument 403 https://infinityfree.net/errors/403/
ErrorDocument 404 https://infinityfree.net/errors/404/
ErrorDocument 500 https://infinityfree.net/errors/500/

我已将 http://norway-yv.epizy.com/website/myerrorpages/[errornum].html 配置为 InfinityFree 控制面板中的错误页面路径

htdocs(文件夹,自动创建)

index.html

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>norway-yv</title>
    </head>
    <body>
        <meta http-equiv="refresh" content="0; url=website/home.html">
    </body>
</html>

website(文件夹,手动创建)

index.html

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>norway-yv</title>
    </head>
    <body>
        <meta http-equiv="refresh" content="0; url=home.html">
    </body>
</html>

home.html

<html lang="en">
    <head>
        <title>norway-yv | home</title>
        <link rel="icon" type="image/png" href="../files/icons/favicon.png">
        <link rel="stylesheet" href="style/normal.css">
    </head>

    <body>
        <header>
            <a href="home.html">
                <img class="logoTop" src="files/icons/favicon.png" alt="Logo" />
            </a>
        </header>
        <h1>This is the website of norway-yv</h1>
        <p>I'm sorry for the horrible look of my website, but it is the best I can do</p>
        <h2>About me</h2>
        <p>I am a hobby developer who likes programming in Python. I am a student in Norwegian upper secondary school, year 1.<br>
            Some of my best projects can be found <a href="projects.html" >here.</a><br>
            Feel free to contact me trough GitHub.</p>
        <h2>Contact</h2>
        <p>
            <a href="https://whosebug.com/users/17496608/norway-yv" >Whosebug</a><br>
            <a href="https://github.com/norway-yv"> GitHub (via GitHub e-mail)</a><br>
        </p>
    </body>
</html>

projects.html

<html lang="en">
    <head>
        <title>norway-yv | projects</title>
        <link rel="icon" type="image/png" href="../files/icons/favicon.png">
        <link rel="stylesheet" href="style/normal.css">
    </head>

    <body>
        <header>
            <a href="home.html">
                <img class="logoTop" src="files/icons/favicon.png" alt="Logo" />
            </a>
        </header>
        <h1>My projects</h1>
        <p>I have made tons more than this, mainly for scientific and mathematic purposes, but these are some of the projects I am most proud of:</p>
        <h2>kode24-calculator</h2>
        <p>An ongoing project, where I try to calculate expected wage for Norwegian developers using many different parametres.<br>
            For more information, see <a href="projects/kode24-calculator.html"> here. </a></p>
        <h2>binary-calculator</h2>
        <p>A project that sort of is finished, but still has a long way to go. Currently, it can calculate the sum of two binary numbers up to 32 bit size and output it.<br>
            For more information, see <a href="projects/binary-calculator.html"> here. </a></p>
    </body>
</html>

我的评论在最后

我的网站上还有很多其他文件夹。如果有必要,我可以将它们添加到问题中。但我希望不会。
同样的问题在预览时出现(使用边缘显示本地版本)。所以我的文件问题比 InfinityFree 更严重。

可能它不起作用,因为您在 <head> 中缺少 <base> 标签。 base 标签定义了 base URL,相对 URLS 从那里被重定向。

For more