Hi,
I'm trying to make
site.com/home.php rewrited to
site.com/site.php?pg=home so all my URL will be:
Code:
site.com/home.php
site.com/about.php
site.com/contact.php
etc..
instead of:
Code:
site.com/site.php?pg=home
site.com/site.php?pg=about
site.com/site.php?pg=contact
etc..
in my php code I have:
Code:
$pg= $HTTP_GET_VARS['pg'];
$pg = $pg.".php";
include_once $pg;
and my .htaccess is:
Code:
RewriteRule ^(.*)\.php$ site.php?pg=$1 [L]
But it does'nt work. "echo $pg" always return "site.php" instead of the page that was in the url... So the page make an infinite loop trying to include site.php inside site.php and apache make a 500 error.
I don't find my mistake...
Could someone give my a hint please?
Thank you