一个href只会将我发送到子公司,而不是其他任何地方 [英] a href only will send me to subdirecteries and not anywhere else

查看:103
本文介绍了一个href只会将我发送到子公司,而不是其他任何地方的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所有这些链接都会将我发送到我网站的子网站,但我无法让他们将我发送到mysite.com,google.com或url.com这样的地方。

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>

所以,如果我点击谷歌按钮,它会发送给我mysite.com/www.google .com

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

推荐答案

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

这应该有效。您需要添加http://,因为它是外部链接

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

这篇关于一个href只会将我发送到子公司,而不是其他任何地方的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆