Request exceeded the limit of 10 internal redirects due to probable configuration error.?

后端 未结 3 1210
天命终不由人
天命终不由人 2020-12-01 04:36

i have a simple rewrite

RewriteRule ^.*$ addnew/$0

however i get the

Request exceeded the limit of 10 internal redirects d         


        
相关标签:
3条回答
  • 2020-12-01 05:11

    As RC already said, .* will also match addnew/. And since the L flag causes a reinjection of the rewritten rule, you will get an infinite recursion.

    So adjust the rule so it doesn’t match your addnew/:

    RewriteRule !^addnew/ addnew%{REQUEST_URI}
    
    0 讨论(0)
  • 2020-12-01 05:12

    .*matches addnew/. Try with:

    RewriteRule ^[^/]*$ addnew/$0
    
    0 讨论(0)
  • 2020-12-01 05:15

    Try the folllowing solution, it works for me.I hope this will work for you too.

    1. BEFORE DOING ANYTHING - BACKUP YOUR DB!

    2. Now, go into wordpress > settings > permalinks

    3. Set it to one of the pretty permalink settings like //year/month/'

    4. Open a text editor on your PC/Mac and open the .htaccess file you downloaded from your webserver

    5. Find this piece of code

      # BEGIN Wordpress
      <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteBase /
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule . /index.php [L]
      </IfModule>
      # END WordPress
      
    6. Replace it with this piece of code, courtesy of Scott Yang:

      <IfModule mod_rewrite.c>
         RewriteEngine On
         RewriteBase /
         RewriteCond %{REQUEST_FILENAME} !-f
         RewriteCond %{REQUEST_FILENAME} !-d
         RewriteRule ^(.+)$ /index.php/$1 [L,QSA]
      </IfModule>
      
    7. Upload this code into the main domain root directory on your server and you're done.

    Everything should work

    0 讨论(0)
提交回复
热议问题