I also want to 301 redirect any url that ends in .php. Then I internally redirect anything that ends in a / to the name before / plus .php. These both work fine when they are alone. But putting them in the same .htaccess I get a The page isn't redirecting properly.
What am I doing wrong here?
RewriteRule ^(.*)\.php$ /$1/ [R=301,L]
RewriteRule ^(.*)/$ $1.php [QSA,L]