我試圖找出其他網站是否有一種方法,我如何在我的PHP頁面中替換?p=page
到/page
。我想從http://localhost/tapromtour.com/?p=tour_discovery
更改爲http://localhost/tapromtour.com/tour_discovery
。我的主頁上的代碼如下:如何更換?p =頁面/頁面?
<?php
if (isset($_GET["p"])){
$ext =".php";
$file_name = $_GET["p"];
$file = "view/".$file_name.$ext;
if (file_exists($file)){
include $file;
}else{
echo 'no file found';
}
}else{
echo '<meta http-equiv="refresh" content="0; url=?p=home">';
}
?>
我使用此代碼鏈接頁面。如果有請幫助告訴我該怎麼做,是否有任何方法可以從"localhost/tapromtour.com/?p=tour_discovery"
更改爲"localhost/tapromtour.com/tour_discovery"?
。由於
http://localhost/tapromtour.com/?p=tour_discovery
http://localhost/tapromtour.com/tour_discovery
使用'.htaccess' – Thamilan
你能告訴我如何使用它嗎? –
谷歌.htaccess - >嘗試 - >失敗 - >詢問失敗 – omxv