I've been looking for a way to hide the file extensions from URLs and I came across this code:
<IfModule mod_rewrite.c>
## Go Daddy servers need the Options -MultiViews code below
Options -MultiViews
RewriteEngine On
RewriteBase /
# To externally redirect /dir/foo.php to /dir/foo
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R,L,NE]
## To internally redirect /dir/foo to /dir/foo.php
RewriteCond %{REQUEST_FILENAME}.php -f [NC]
RewriteRule ^ %{REQUEST_URI}.php [L]
</IfModule>
It works beautifully until I found out that for some reason this was blocking WP admin features in my WP admin account, meaning I couldn't activate/deactivate plugins, add/edit/delete users and so on. So I was forced to remove the .htaccess file and now I have the .php extensions back in my URLs.
Is there a way of hiding the extensions from my URLs without losing my WP admin capabilities? Cheers.