title: URL rewrites with php5-fpm on apache2
body: <p>i want to use URL rewrites with PHP5.6-FPM on Apache2.2.22 (Debian 7) but i wont work.
  If i activate the URL rewrites via .htaccess file my server throws a 500 error (Request exceeded the limit of 10 internal redirects due to probable configuration error.)</p>
  
  <pre><code>[Mon Oct 12 01:56:09 2015] [error] [client 93.232.122.47] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: ***********
  [Mon Oct 12 01:56:09 2015] [debug] core.c(3116): [client 93.232.122.47] r-&gt;uri = /php5.fcgi/index.php, referer: ***********
  [Mon Oct 12 01:56:09 2015] [debug] core.c(3122): [client 93.232.122.47] redirected from r-&gt;uri = /index.php, referer: ***********
  [Mon Oct 12 01:56:09 2015] [debug] core.c(3122): [client 93.232.122.47] redirected from r-&gt;uri = /php5.fcgi/index.php, referer: ***********
  [Mon Oct 12 01:56:09 2015] [debug] core.c(3122): [client 93.232.122.47] redirected from r-&gt;uri = /index.php, referer: ***********
  [Mon Oct 12 01:56:09 2015] [debug] core.c(3122): [client 93.232.122.47] redirected from r-&gt;uri = /php5.fcgi/index.php, referer: ***********
  [Mon Oct 12 01:56:09 2015] [debug] core.c(3122): [client 93.232.122.47] redirected from r-&gt;uri = /index.php, referer: ***********
  [Mon Oct 12 01:56:09 2015] [debug] core.c(3122): [client 93.232.122.47] redirected from r-&gt;uri = /php5.fcgi/index.php, referer: ***********
  [Mon Oct 12 01:56:09 2015] [debug] core.c(3122): [client 93.232.122.47] redirected from r-&gt;uri = /index.php, referer: ***********
  [Mon Oct 12 01:56:09 2015] [debug] core.c(3122): [client 93.232.122.47] redirected from r-&gt;uri = /php5.fcgi/index.php, referer: ***********
  [Mon Oct 12 01:56:09 2015] [debug] core.c(3122): [client 93.232.122.47] redirected from r-&gt;uri = /index.php, referer: ***********
  [Mon Oct 12 01:56:09 2015] [debug] core.c(3122): [client 93.232.122.47] redirected from r-&gt;uri = /intern/, referer: ***********
  [Mon Oct 12 01:56:09 2015] [debug] mod_deflate.c(700): [client 93.232.122.47] Zlib: Compressed 637 to 391 : URL /php5.fcgi/index.php, referer: ***********
  </code></pre>
  
  <p>.htaccess</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
     # Enable URL rewriting
     RewriteEngine Off
  
     # Store the current location in an environment variable CWD to use
     # mod_rewrite in .htaccess files without knowing the RewriteBase
     RewriteCond $0#%{REQUEST_URI} ([^#]*)#(.*)\1$
     RewriteRule ^.*$ - [E=CWD:%2]
  
     # Rule for versioned static files, configured through:
     # - $GLOBALS['TYPO3_CONF_VARS']['BE']['versionNumberInFilename']
     # - $GLOBALS['TYPO3_CONF_VARS']['FE']['versionNumberInFilename']
     # IMPORTANT: This rule has to be the very first RewriteCond in order to work!
     RewriteCond %{REQUEST_FILENAME} !-f
     RewriteCond %{REQUEST_FILENAME} !-d
     RewriteRule ^(.+)\.(\d+)\.(php|js|css|png|jpg|gif|gzip)$ $1.$3 [L]
  
     # Access block for folders
     RewriteRule _(?:recycler|temp)_/ - [F]
     RewriteRule fileadmin/templates/.*\.(?:txt|ts)$ - [F]
     RewriteRule typo3temp/logs/ - [F]
     RewriteRule ^(vendor|typo3_src) - [F]
     RewriteRule (?:typo3conf/ext|typo3/sysext|typo3/ext)/[^/]+/(?:Configuration|Resources/Private|Tests?)/ - [F]
  
     # Access block for files or folders starting with a dot
     RewriteCond %{SCRIPT_FILENAME} -d [OR]
     RewriteCond %{SCRIPT_FILENAME} -f
     RewriteRule (?:^|/)\. - [F]
  
     # Stop rewrite processing, if we are in the typo3/ directory or any other known directory
     # NOTE: Add your additional local storages here
     RewriteRule (?:typo3/|fileadmin/|typo3conf/|typo3temp/|uploads/|favicon\.ico) - [L]
  
     # If the file/symlink/directory does not exist =&gt; Redirect to index.php.
     # For httpd.conf, you need to prefix each '%{REQUEST_FILENAME}' with '%{DOCUMENT_ROOT}'.
     #RewriteCond %{REQUEST_URI} !^/fastcgiphp/*
     RewriteCond %{REQUEST_FILENAME} !-f
     RewriteCond %{REQUEST_FILENAME} !-d
     RewriteCond %{REQUEST_FILENAME} !-l
     RewriteRule ^.*$ %{ENV:CWD}index.php [QSA,L]
  
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>VirtualHost:</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
     AddHandler php5-fcgi .php
     Action php5-fcgi /php5.fcgi
     Alias /php5-fcgi /var/www/php5-fcgi
     FastCgiExternalServer /var/www/php5.fcgi -socket /var/run/php5-fpm.sock -pass-header Authorization
     ServerAdmin webmaster@localhost
  
     DocumentRoot /var/www
     #&lt;Directory /&gt;
     #       Options FollowSymLinks
     #       AllowOverride none
     #&lt;/Directory&gt;
     &lt;Directory /var/www/&gt;
            Options Indexes FollowSymLinks MultiViews
            AllowOverride FileInfo AuthConfig Limit Indexes Options
            Order allow,deny
            allow from all
     &lt;/Directory&gt;
  
     ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
     &lt;Directory "/usr/lib/cgi-bin"&gt;
            AllowOverride None
            Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Order allow,deny
            Allow from all
     &lt;/Directory&gt;
  
     ErrorLog ${APACHE_LOG_DIR}/error.log
  
     # Possible values include: debug, info, notice, warn, error, crit,
     # alert, emerg.
     LogLevel debug
  
     CustomLog ${APACHE_LOG_DIR}/access.log combined
  &lt;/VirtualHost&gt;
  </code></pre>