2017-02-10 111 views
-1

所以我使用XAMPP,但是当我点击一个链接时,它会将我重定向到localhost/dashboard而不是我想要的页面。我怎样才能解决这个问题?XAMPP重定向到仪表板而不是所需的页面

这是索引页

<!DOCTYPE html> 
<html> 
<head> 
<title>SG Weredi</title> 
<link rel="stylesheet" type="text/css" href="style.css"> 
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script> 
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> 
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> 
<meta name="viewport" content="width=device-width, initial-scale=1"> 
<script src="loginpagina.js"></script> 
</head> 
<body> 


    <div class="header"> 
    <a href="/">Your App Name</a> 
    </div> 

    <div class="container-fluid"> 
    <img class =" logo" src="http://www.weredi.nl/logo.png"> 
    </div> 

    <?php if(!empty($user)): ?> 

    <br />Welcome <?= $user['email']; ?> 
    <br /><br />You are successfully logged in! 
    <br /><br /> 
    <a href="logout.php">Logout?</a> 

    <?php else: ?> 

    <h1>Please Login or Register</h1> 
    <a href="Infproject/login.php">Login</a> or 
    <a href="register.php">Register</a> 

    <?php endif; ?> 

</body> 
</html> 
+0

请发布您的.htaccess重写规则。 –

+0

我已经尝试删除htdocs中的index.php文件,但我进入了localhost页面。当我点击该项目重定向到我的索引页面,但链接不起作用 –

+0

您点击了哪个链接? –

回答

1

唯一链接的代码,这是正确的<a href="register.php">Register</a>

您应该登录做同样的:的

<a href="login.php">Login</a>

代替

<a href="Infproject/login.php">Login</a>

同样的解决方案是链接至项目的主页:

<div class="header"> <a href="./">Your App Name</a> </div>

,而不是

<div class="header"> <a href="/">Your App Name</a> </div>

因为href="/"在您的网站重定向到index.phpC:/xampp/htdocs其重定向到C:/xampp/htdocs/dashboard/localhost/dashboard)。

相关问题