I am sharing here how you can remove .php extension from Url of your website. here are the following steps:-
Create a .htaccess file in project directory.
Suppose you have to remove the .php extension from a PHP file for example abc.com/test.php to abc.com/test you have to add the following code inside the .htaccess file:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
Now load your website in browser, you will able to load php pages without .php.
If you want to remove .html from html file, you have to replaced last line of the above code as mentioned below :-
0 Comment(s)