title: This webpage has a redirect loop - Wordpress + custom rewrites
body: <p>I'm trying to run a site that routes all URI requests through an index.php file for processing, but I'm also trying to run Wordpress at the webroot. Everything works fine, except for requests to <a href="https://mysite.com/wp-admin/" rel="nofollow">https://mysite.com/wp-admin/</a>, which gives me a "This webpage has a redirect loop" error.  Going to <a href="https://mysite.com/wp-admin/edit.php" rel="nofollow">https://mysite.com/wp-admin/edit.php</a> works fine.</p>
  
  <p>My .htaccess file looks like this: </p>
  
  <pre><code>RewriteEngine On
  
  # eliminate www
  RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
  RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
  
  # force SSL
  RewriteCond %{HTTPS} !=on
  RewriteRule .* https://%{SERVER_NAME}/%1 [R,L]
  
  RewriteBase /
  
  # rewrite directory patterns
  RewriteRule ^([a-zA-Z0-9-\/]+)/([a-zA-Z0-9-%/\/]+)/([0-9]+)$    /index.php?page=$1&amp;action=$2&amp;id=$3  [NC,QSA,L] 
  RewriteRule ^([a-zA-Z0-9-\/]+)/([a-zA-Z0-9-%/\/]+)$ /index.php?page=$1&amp;action=$2    [NC,QSA,L] 
  RewriteRule ^([a-zA-Z0-9-\/]+)$ /index.php?page=$1  [NC,QSA,L] 
  
  # Wordpress
  &lt;IfModule mod_rewrite.c&gt;
  RewriteRule ^index\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.php [L]
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>Any ideas what's causing the redirect loop? I've tried putting </p>
  
  <pre><code>RewriteCond %{REQUEST_URI} !wp-admin
  </code></pre>
  
  <p>in front of the force SSL and eliminate www rules, but it doesn't seem to make a difference</p>