1

My subdomain is sample and consider my domain name is demodomain.I want to link 'www.google.com'. My href will link to 'http://www.sample.demodomain.com/www.google.com'.

html code:
   <a target="_blank" href="www.google.com">click me</a>

I want to be redirected to www.google.com.but now I get redirected to http://www.sample.demodomain.com/www.google.com.

3
  • So you just want to redirect to google?
    – Rizier123
    Commented Dec 13, 2014 at 11:27
  • 2
    href="http://google.com" ?? Commented Dec 13, 2014 at 11:30
  • its actually https://www.google.com Commented Dec 13, 2014 at 11:39

3 Answers 3

5

Put http:// in href before the url

2

You need to have http:// in the URL you would like to be redirected to.

1

You have to add http://. If you don't the browser thinks that you want to link to an htmlpage or a file called "www.google.com" not the original website so here you are:

 <a target="_blank" href="http://www.google.com">click me</a>
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.