title: htaccess redirecting loop with browser
body: <pre><code>&lt;ifModule mod_rewrite.c&gt;
  ErrorDocument 404 /notfound.html
  RewriteEngine On
  Options +FollowSymLinks -Indexes -MultiViews
  RewriteBase /
  
  RewriteRule ^(gateway)($|/) - [L]
  RewriteRule ^(inc)($|/) - [L]
  
  # make sure it's not a directory or a file
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  
  # match out the request URI without the trailing slash
  RewriteCond %{REQUEST_URI} ^/([^/]+?)/?$
  # and see if it exists
  RewriteCond %{DOCUMENT_ROOT}/%1.php -f
  
  RewriteRule ^(.+?)/?$ /$1.php [L]
  
  RewriteCond %{REQUEST_METHOD} !POST [NC]
  # To externally redirect /dir/foo.php to /dir/foo
  RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.+?)\.php
  RewriteRule ^(.+?)\.php$ /$1 [L,R=301]
  
  ## To internally redirect /dir/foo to /dir/foo.php
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{DOCUMENT_ROOT}/$1\.php -f
  RewriteRule ^(.+?)/?$ $1.php [L]
  
  
  RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+index.php\?id=([a-z0-9]+)&amp;num=([a-z0-9]+) [NC]
  RewriteRule ^ %1/%2/ [R=301,L,NC]
  RewriteRule ^([a-z0-9]+)/([a-z0-9]+)/?$ /index.php?id=$1&amp;num=$2 [L,NC]
  
  &lt;/ifModule&gt;
  </code></pre>
  
  <p>Hi guys,
  I have trouble with htaccess. It still warning by browser about This webpage has a redirect loop
  I find more solution but i can't fix it :(
  i tried to rewrite/redirect *.php to directory sample index.php to /index
  And i want to rewrite url index.php?id=read&amp;num=11233445667 to /read/11233445667</p>
  
  <p>It worked. But still "This webpage has a redirect loop" :(</p>
  
  <p>Please help me fix htaccess above. Im very thank you!</p>