How to write .htaccess for following links? Something like home.php/page/about

home.php?page=about
home.php?page=services
home.php?page=events
home.php?page=gallery&id=1 //redirected from home.php?page=events//
home.php?page=contact

home.php

$default = 'default'; 
$page = isset($_GET['page']) ? $_GET['page'] : $default;  
if (!file_exists(''.$page.'.php'))    {
    $page = $default;
} 
include(''.$page.'.php');

e.g
page=about is used to get about.php

include(''.$page.'.php'); this includes **about.php ** for this example

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.