Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

<a href ="somewebsite.com"> takes to localhost/somewebsite.com , Why?

Tags:

html

href

I want to open somewebsite.com , but it goes to localhost/somewebsite.com , why its taking relative path.

like image 526
Ajay Kelkar Avatar asked Jan 01 '10 18:01

Ajay Kelkar


People also ask

What is href =# in HTML?

Definition and UsageThe href attribute specifies the URL of the page the link goes to. If the href attribute is not present, the <a> tag will not be a hyperlink. Tip: You can use href="#top" or href="#" to link to the top of the current page!

What is href JavaScript:;?

HREF JavaScript is a method to easily call a JavaScript function when a user clicks on a link on a website. If you've ever clicked a link and received a pop-up box, such as an alert dialog, then you've potentially seen this function in action.


1 Answers

Your link is missing the protocol at the start of the URL: http:// for pages not using SSL, https:// for pages securing data transfer using SSL.

If you want a link that works in either scenario, you can use // instead of the fully qualified protocol.

like image 108
avpx Avatar answered Oct 05 '22 12:10

avpx