I have tried to find out in other websites whether there is a way on how to I replace ?p=page
to /page
in my PHP page. I want to change from http://localhost/tapromtour.com/?p=tour_discovery
to http://localhost/tapromtour.com/tour_discovery
. My code in my homepage is as below:
<?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">';
}
?>
I use this code to link from page to page. Is there any ways to change from "localhost/tapromtour.com/?p=tour_discovery"
to "localhost/tapromtour.com/tour_discovery"?
if there is please help tell me how to do it. Thanks
http://localhost/tapromtour.com/?p=tour_discovery
http://localhost/tapromtour.com/tour_discovery