重定向到WWW后提示登录

时间:2017-09-04 18:22:00

标签: apache .htaccess authentication redirect

我需要首先重定向到WWW然后请求基本身份验证

<table>
 <tr>
  <th>Transaction ID</th>
  <th>Customer ID</th>
  <th>Description</th>
  <th>Amount</th>
  <th>Date</th>
 </tr>
<?php
    $stmt0 = $mysqli->prepare("SELECT id FROM customers WHERE status = ?");
    $stmt0->bind_param('i',$status);
    $stmt0->execute();
    $stmt0->store_result();
    $stmt0->bind_result($cust_id);
    while ($stmt0->fetch()) 
    {
      $stmt = $mysqli->prepare("SELECT id,description,amount,date FROM transactions WHERE cust_id = ? ORDER BY id DESC");
      $stmt->bind_param('i',$cust_id);
      $stmt->execute();
      $stmt->store_result();
      $stmt->bind_result($id,$description,$amount,$date);
      while ($stmt->fetch()) 
      {
?>
 <tr>
  <td><?php echo $id; ?></td>
  <td><?php echo $cust_id; ?></td>
  <td><?php echo $description; ?></td>
  <td><?php echo $amount; ?></td>
  <td><?php echo $date; ?></td>
 </tr>
<?php 
      }
        $stmt->close();
    }
      $stmt0->close();
?>
</table>  

如果我去 test.com ,我会看到登录提示。我输入凭据然后我被重定向到 www.test.com 并再次提示登录。我想先重定向到WWW,所以我输入一次凭证。

0 个答案:

没有答案