-4

i'm trying to create a link that redirect to another website like this :

<a target="_blank" href="exemple.com/test">hello</a>

but it redirect me to mywebsite.com/exemple.com/test

How can i make it work ? :)

EDIT : Correct answer was to use // before url

href="//exemple.com/test"
Jeremy M.
  • 1,154
  • 1
  • 9
  • 29
  • Please read the entire question before saying it's duplicate.... – Jeremy M. Feb 26 '18 at 11:52
  • 1
    _“i need to make it work with this url”_ - you can’t, because that’s not how URLs work. `exemple.com/test` _is_ a relative URL, that refers to a file or folder named `test` inside a folder named `exemple.com` inside the current directory. So your question makes very little sense to begin with. – CBroe Feb 26 '18 at 11:52
  • You did not understand then. exemple.com/test is another website. If you put my url inside google search bar it will find my website. – Jeremy M. Feb 26 '18 at 11:58
  • @JérémyMisiti — The Google Search bar is doing a *search* not following a URL. – Quentin Feb 26 '18 at 11:59

2 Answers2

1

You are giving relative URL. Give absolute url instead to achieve your goal.

e.g.

<a target="_blank" href="http://www.exemple.com/test">hello</a>
Ishwar Patil
  • 1,671
  • 3
  • 11
  • 19
0

Try This:

<a target="_blank" href="//exemple.com/test">hello</a>