How to remove .php extension from URL using htaccess | PHP Gurukul

Remove the .php extension from the URL

To remove the .php extension from a PHP file for example phpgurukul.com/contactus.php to phpgurukul.com/contactus you have to add the following code inside the .htaccess file:

In the above code, the first line checks that the request is a URL and not a directory. The second line redirects matching URLs with .php extension to those without the file extension. The last line redirects matching requests to URLs without a PHP file extension.

Similarly, we can remove the .html extension from the URL

Click : https://phpgurukul.com/how-to-remove-php-extension-from-url-using-htaccess/

Publicado en Default Category en noviembre 18 at 11:54
Comentarios (0)
No login
Inicie sesión o regístrese para enviar su comentario
Cookies on De Gente Vakana.
This site uses cookies to store your information on your computer.