user1082764
user1082764

Reputation: 2015

a href only will send me to subdirecteries and not anywhere else

all these links send me to a subdirectery of my site but i cant get them to send me to places like mysite.com, google.com or url.com.

<div id="header">
            <div id="loggedoutmainnav">
                <ul>
                    <li><a href ="<?php echo $_SERVER['SERVER_NAME']; ?>"><?php echo $_SERVER['SERVER_NAME']; ?></a></li>
                    <li><a href ="www.google.com">Google</a></li>
                    <li><a href ="url.com">Url</a> </li>
                    <li><a href ="#">Plans & Pricing</a></li>
                    <li><a href="#">Log in</a></li>
                </ul>
            </div>
        </div>

so if i click on the google button, it will send me to mysite.com/www.google.com

Upvotes: 1

Views: 80

Answers (2)

NightHawk
NightHawk

Reputation: 3691

You need to add http:// before the URL for external sites.

Upvotes: 2

Johannes Staehlin
Johannes Staehlin

Reputation: 3720

<a href ="http://www.google.com">Google</a>

This should work. You need to add "http://" because it's an external link

Upvotes: 4

Related Questions