您好,我有一个使用html和CSS创建的网站。它有很多不同的页面。我发布了该网站,并将其添加到了Google。不幸的是,当您在Google中搜索omicrome时,出现了主页(index.html),这是google中唯一的页面。我不知道是否必须在代码中添加一些内容。另外,当我在网站上并单击将我带到网站其他页面的按钮时,它仍然在网址上显示omicrome.com/,但应该显示omicrome.com/about,为什么它不这样做?我是否必须在代码中添加一些内容?我将GoDaddy和Google Drive用于我的域和托管。
编辑:这是index.html页面的代码,因此您可以看到我的编码方式:

     <html>
     <head>
     <title>Omicrome</title>

     <link rel="SHORTCUT ICON" href="img/icon.ico" type="image/x-icon" />
     <link rel="ICON" href="img/icon.ico" type="image/ico" />

     <link rel="stylesheet" href="css/reset.css">
     <link rel="stylesheet" href="css/text.css">
     <link rel="stylesheet" href="css/960_24_col.css">
     <link rel="stylesheet" href="css/style.css">

     <meta name="Description" CONTENT="Omicrome is the place to be for       technology, science, space, gaming and internet news with the odd side of comedy. New content daily.">


  </head>
   <body>

  <div class = "container_24">
  <header>
<h1>Omicrome</h1>
    <nav>
        <ul>
            <li><a href="# " class = selected>Home</a></li>
            <li><a href="news.html">Articles</a></li>
            <li><a href="software.html">Software</a ></li>
            <li><a href="about.html">About</a></li>
        </ul>
    </nav>

    <div class = "banner grid_18" href="about.html">
     <a href="elonmusk.html"  class="button" id ="new">View Article</a>

        <h2>

        </h2>
    </div>
    <div class=" grid_8 callout"></div>
     <a href="software.html"  class="button" id ="spacesoft">View Software</a>
  </header>




  <div class = "main clearfix">
  <div class ="grid_9">
      <h3>About The Site</h3>
     <p>Omicrome is where you get all your amazing content. Between tech, space, films and internet news, we've got it all here on Omicrome. We also post software and other downloadable projects on the site for you to use and enjoy. Check back daily for new interesting content or go to the articles section to see all of our content in one place.


    <p><a href="about.html"  class="button">Find Out More</a></p>
   </div>

   <div class ="grid_9">
    <h3>Our Content</h3>
        <p>Every day we post about different things. Sometimes   we post about space, technology, films, games and the internet but you can also find news on events, the internet and even see what we're up to! Make sure to check back daily!
    </p><p>
    </p><p>  </p>
    <br>

 <p><a href="about.html" class="button">Find Out More</a></p>
</div>
    </div>
    <footer><p><strong>Omicrome</strong><a href="#"></a></p></footer>

     </div>

     </div>
    </body>
    </html>

最佳答案

它之所以要编制索引,是因为这就是Internet的工作方式。它寻找索引,如果存在,则去那里。那是正常的。

为使URL不变,您需要使用拼写不同的文件名。例如,如果您有home.html,并在此进行重定向,则应为“ omicrome.com/home.html”

检查您的文件是否已命名以及您是否已正确重定向!

关于html - HTML和CSS网站无法正确爬网,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/36378293/

10-09 21:23