i have Apache 2.2 and 3 virtual hosts on it and a mod_rewrite infinite lopp isssue i cannot resolve. Apache is in my company LAN on the 192.168.1.228 IP address. 2 virtual hosts work perfectly. The third makes problems. My network admin created a subdomain to point to that 192.168.1.228. The Virtual Host is configured this way:

<VirtualHost 192.168.1.228>
   DocumentRoot "C:/Apache/htdocs/stansrodowiska"
   ServerName giostube.mycompany.local

  LimitInternalRecursion 1000

  <Directory "C:/Apache/htdocs/stansrodowiska">
      Options Indexes FollowSymLinks Includes
      AllowOverride None
      Order allow,deny
      Allow from all

      RewriteEngine on

      RewriteCond $1 !^(index\.php|images|upload|css|download|assets|js|nfos|robots\.txt)
      RewriteRule ^(.*)$ /stansrodowiska/index.php/$1 [L]

  </Directory>

</VirtualHost> 

If i access this website from my lan over the address: http://giostube.mycompany.local/ i get an

403 Forbidden

You don't have permission to access /stansrodowiska/index.php/stansrodowiska/index.php/stansrodowiska/index.php/stansrodowiska/index.php/stansrodowiska/index.php/stansrodowiska/index.php/stansrodowiska/index.php......... on this server

The /stansrodowiska/index.php/ is of course repeated much more often i think to around 2048 chars which is the HTTP POST maximum. Strange thing is that exactly the same mod_rewrite rules work on an other preconfigured WAMP environment (Vertrigo).
Underneath there is a Codeigniter 1.7.2 application.

Is the error within the mod_rewrite rules or do i have to search elsewhere?

Accepted Answer

Change this line:

RewriteRule ^(.*)$ /stansrodowiska/index.php/$1 [L]

To:

RewriteRule ^(.*)$ /index.php/$1 [L]
Written by Clodoaldo
This page was build to provide you fast access to the question and the direct accepted answer.
The content is written by members of the stackoverflow.com community.
It is licensed under cc-wiki