0

When I use the URL www.w3schools.com, it is redirecting me to a 404 not found page. I don't want to use HTTP or HTTPS because my URL is stored in a database without HTTP.

<!DOCTYPE html>
<html>
<body>

<p>An absolute URL: <a href="www.w3schools.com">W3Schools</a></p>

</body>
</html>
logee
  • 5,017
  • 1
  • 26
  • 34
Mitul Maheshwari
  • 2,647
  • 4
  • 24
  • 38
  • So there is a different way of assigning `href` to `a` if you are fetching it from `db` right? For other options **[read here](http://stackoverflow.com/q/8997790/2065039)** – Guruprasad J Rao Sep 30 '15 at 12:27

1 Answers1

0

If you use a protocol agnostic URL it should alleviate this problem.

I.e. "//www.w3schools.com"

This should adopt the necessary protocol (http, https, etc.) on its own and prevent the 404 error.

Eric Schmidt
  • 1
  • 1
  • 4