[英]XAMPP redirects to dashboard instead of desired page
所以我正在使用 XAMPP,但是當我點擊一個鏈接時,它會將我重定向到 localhost/dashboard 而不是我想要的頁面。 我怎樣才能解決這個問題?
這是索引頁面的代碼
<!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>
唯一正確的鏈接是<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="/"
將您重定向到C:/xampp/htdocs
中的index.php
,它重定向到C:/xampp/htdocs/dashboard/
( localhost/dashboard
)。
嘗試將端口號更改為新端口號並重新啟動 apache 服務器。 我將端口號從 8082 更改為 8084 並重新啟動了服務器。 這對我有用。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.