||03-28-2012 02:52 PM
I'm trying to make site.com/home.php
rewrited to site.com/site.php?pg=home
so all my URL will be:
in my php code I have:
$pg = $pg.".php";
and my .htaccess is:
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?
||03-30-2012 01:41 PM
I made it work this way:
RewriteRule ^([a-z]+)/?$ site.php?pg=$1 [L]
But it don't wan't to work if I add the php extension like before:
RewriteRule ^([a-z]+)\.php$ site.php?pg=$1 [L]
|All times are GMT +1. The time now is 09:23 AM.
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.