-1

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,

Eamorr
  • 596
  • 5
  • 13
  • 27

1 Answers1

1

There are at least two ways to do it.

  • With Apache's mod_rewrite:
    RewriteEngine On
    RewriteCond %{QUERY_STRING} =facebook [NC]
    RewriteRule (.*)/index.php$ $1/facebook.php [R,L]
  • Within the 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;
    }
Steven Monday
  • 13,019
  • 4
  • 35
  • 45