Search code examples
htmlhttpshttp-status-code-404href

html Not Found error


I'm just a student of html, and I write just a simple code to learn html.. And I got one question.

If i write code

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>html practice</title>
</head>
<body>
    move to <a href=google.com" target="_blank"><strong>google</strong></a>
</body>
</html>

this link doesn't work

But when i change my code to <a href="https://www.google.com" target="_blank">, it works very well.

I don't know why and i'm very curious.. Please help me...


Solution

  • You need the http:// or https:// in front of google.com, otherwise the browser will think it is a file held locally on your webserver instead of an external site link.