Thanks to .htaccess we can hide our .php/.html extensions of our files within the url when accessing our website. In this way, it will not be necessary to enter the full path and it will be accessible both WITH and WITHOUT extension.
To achieve this we simply must add this small code in our .htaccess file to eliminate the php extensions. The first thing we have to do is access the cPanel of our service of hosting. If the .htaccess file does not exist, we must create one and place it in the root directory of our hosting plan (inside the public_html folder). In the case of .html extensions we will use the same code changing .php for .html.
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php