0

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

2
Contributors
1
Reply
13
Views
2 Years
Discussion Span
Last Post by imti321
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.