.htaccess redirection to tidy URL
<p>This is what my <strong>.htaccess</strong> file looks like:</p>

<pre><code>RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule .* - [L]

#removes trailing slash if not a directory
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/$ /$1 [R=301,L]

#adds ".php" to a URL that isn't a directory or a file
RewriteCond %{REQUEST_URI} !(\.[^./]+)$
RewriteCond %{REQUEST_fileNAME} !-d
RewriteCond %{REQUEST_fileNAME} !-f
RewriteRule (.*) $1.php [L]
</code></pre>

<p>Although it lets me access the url without the .php in the end for e.g. <code>example.com/sign-up</code>
It does not redirect me from <code>example.com/sign-up.php</code> to <code>example.com/sign-up</code></p>

<p>Is there any code which I can add to this file to make that happen?</p>

<p>Any insight would be very helpful</p>