I'm trying to create friendly url for administrative page, i do it well with website separate pages but when it comes to put link on variable i can't get it. here's my code:
index.php:
<?php include_once("menu/menu_adm.php");
$pag[1] = "user/profile.php";
$pag[2] = "user/edit_user.php";
if(!empty($_GET["link"])){
$link = $_GET["link"];
if(file_exists($pag[$link])){
include $pag[$link];
}else{
include "home.php";
}
}else{
include "home.php";
}
?>
The actual url looks like this: "localhost/system/admin/index.php?link=1" I need to turn this into "localhost/system/admin/user/profile"
I'm not expert in .htaccess so if you can do a example it will be very helpful. thanks.