Possible Duplicate:
Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask?
Is it possible to redirect ./index.php?facebook to ./facebook.php? If so, how to do this?
Many thanks in advance,
Possible Duplicate:
Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask?
Is it possible to redirect ./index.php?facebook to ./facebook.php? If so, how to do this?
Many thanks in advance,
There are at least two ways to do it.
mod_rewrite: RewriteEngine On
RewriteCond %{QUERY_STRING} =facebook [NC]
RewriteRule (.*)/index.php$ $1/facebook.php [R,L]
index.php PHP script itself (my PHP is very rusty; consider this to be pseudo-code): if (isset($_GET['facebook'])) {
header('Location: facebook.php');
exit;
}