how to remove .php extension from url in php by Basant | Dec 4, 2019 | PHPremove .php extension from url in php Just follow these stepsOpen .htacess file and copy below code in .htacess file RewriteEngine On RewriteRule ^test?$ test.php Here test is your page name Now you can visit your page like abc.com/testremove ?id from url in phpif your url is user.php?id=1 then just copy the below code in your htacess fileRewriteEngine On RewriteRule ^user/([0-9]+) user.php?id=$1 RewriteRule ^test?$ test.php RewriteRule ^user/([0-9]+) user.php?id=$1 RewriteRule ^shop/cat/([0-9a-zA-Z]+)/subcat/([0-9a-zA-Z]+) shop.php?cat=$1&subcat=$2 That’s It. Now you see a magic in your url