-1

Can anyone help me figure out why I am getting this error, below is my htaccess

RewriteEngine ON
RewriteRule ^(.*)\.php$ /$1 [R=301,L,END]
RewriteRule ^([^\.\/]+)$ /$1.php [QSA,L] 
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
user4795555
  • 13
  • 1
  • 3
  • What is the error? You may want to have a look at [How to Ask] for some tips on how to ask answerable questions here. – scotthenninger Apr 29 '16 at 14:17
  • 2
    Possible duplicate of [Remove .php extension with .htaccess](http://stackoverflow.com/questions/4026021/remove-php-extension-with-htaccess) – Amit Verma Apr 29 '16 at 14:26

1 Answers1

0

Your first rule may not require END but 2nd rule will definitely require END flag to stop infinite redirection. You can use following rules in Apache 2.4:

RewriteEngine On

RewriteRule ^(.+)\.php$ /$1 [R=302,L,NE,NC]

RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+?)/?$ $1.php [END]
anubhava
  • 761,203
  • 64
  • 569
  • 643