I've often used...
- Code: Select all
RewriteRule ^(.*)\.html$ index.php?page=$1
... in .htaccess, then PHP to grab the page name...
- Code: Select all
$page = $_GET['page']
So a URL of www.domain.com/test.html outputs the $_GET['page'] variable as "test". Now, I have a site that all the existings pages have .php extension, but I want to do the same thing. When I do this in htaccess...
- Code: Select all
RewriteRule ^(.*)\.php$ index.php?page=$1
And an URL like www.domain.com/test.php, my PHP script outputs "index" as the $_GET['page'] variable.
I've tried lots of things, but can't crack it. Any help PLEASE???
Thanks a million!
Philip