title: How can I use .htaccess to hide .php URL extensions?
body: <p>I want something to put in my <code>.htaccess</code> file that will hide the <code>.php</code> file extension for my php files, so going to www.example.com/dir/somepage would show them www.example.com/dir/somepage.php.</p>
  
  <p>Is there any working solution for this? My site uses HTTPS, if that matters at all.</p>
  
  <p>This is my .htaccess at the moment: </p>
  
  <pre><code>RewriteEngine On
  
  RewriteCond %{SERVER_PORT} 80 
  RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]
  
  ErrorDocument 404 /error/404.php
  
  RewriteCond %{REQUEST_FILENAME}.php -f
  RewriteCond %{REQUEST_URI} !/$
  RewriteRule (.*) $1\.php [L]
  </code></pre>