Faced a problem in setting up redirects. It is necessary on the site with old links that ended with the .php extension to make redirects to the same links, but without the extension. Found a solution, everything works. But the site on WP, and this rule in htaccess affects the admin area, and there this extension is needed. Can someone tell me how to exclude the admin from the rule? Thank you in advance!

# RewriteCond %{REQUEST_FILENAME} !-f # RewriteRule ^(.*)\.php$ $1 [R=301,L] 
  • Well, you read something about RewriteCond ? - teran
  • Doesn't the real files go to the admin panel? If to them, then the string condition RewriteCond %{REQUEST_FILENAME} !-f should not give the green light to trigger the redirect. - Visman

0