我使用 .htaccess 将所有流量路由到单个 index.php 文件。下面的代码用于引导流量,但由于某种原因它不适用于后退按钮。我不知道该怎么做才能让后退按钮工作。我尝试了各种各样的东西,并在谷歌上搜索了很多,但都没有奏效,所以我希望这里有人可以提供帮助!
<?php
if(isset($_GET['parameters'])) {
if($_GET['parameters'] == "repair")
include 'repair.html';
else if($_GET['parameters'] == "training")
include 'training.html';
else if($_GET['parameters'] == "products")
include 'products.html';
else if($_GET['parameters'] == "about")
include 'about.html';
else if($_GET['parameters'] == "employees")
include 'employees.html';
else if($_GET['parameters'] == "training")
include 'training.html';
else if($_GET['parameters'] == "newaccount")
include 'newaccount.html';
else if($_GET['parameters'] == "contact")
include 'contact.html';
else if($_GET['parameters'] == "recommended")
include 'recommended.html';
else if($_GET['parameters'] == "careers")
include 'careers.html';
else
include 'home.html';
}
else
include 'home.html';
?>
到目前为止,我已经尝试并未能使用: window.onbeforeunload
body onunload=""
必须有办法onunload=location.reload()
或某事!不知何故必须知道语法!