Q:

static Codeigniter application on subdomain

I am writing an application which is required to be hosted on a server which already has existing applications in use. normal url 'www.site.org.au' displays a normal webpage,
and there are then as well two subdomains app.site.org.au and test.site.org.au, for our application and test server.
I am developing this application on a local xampp server, but i want to be able to develope this on a subdomain so that when it comes to putting the application live, hopefully there will not be as much messing and screwing around.
For this, i have the following https-vshost.conf
<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs/test"
    ServerName test.localhost.com
</VirtualHost>

and similarly I have added to my hosts file 
127.0.0.1       test.localhost.com

As can be seen, i have set up the directory in the htdoc folder so that when i visit test.localhost.com, i load the pages in the test folder within htdocs.
I have the .htaccess file as followed
<IfModule mod_rewrite.c>
    Options +FollowSymLinks
    Options +Indexes
    RewriteEngine On

    RewriteBase /

    RewriteCond %{HTTP_HOST} !www.example.com$ [NC]
    RewriteCond %{REQUEST_URI} ^/$
    RewriteCond %{HTTP_HOST} ^(www.)?([a-z0-9-_]+).example.com [NC]
    RewriteRule (.*) /index.php/controller/function/%2 [P]

    RewriteCond $1 !^(index\.php|images|robots\.text|css|js);
    RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

Currently visiting test.localhost.com gives me a 500 Internal Server Error
The subdomain will only pertain to a single application, and hense also need to be able to use any controllers within.
so, what am i doing wrong here?
EDIT: 
Error Log displays the following Lines for each request
[Tue Oct 29 08:55:10.044889 2013] [core:error] [pid 5884:tid 1652] [client 127.0.0.1:52811] AH00124: 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.
[Tue Oct 29 08:55:10.044889 2013] [core:error] [pid 5884:tid 1652] [client 127.0.0.1:52811] AH00124: 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.

A:

You error is that you have a stray ; in your second rule's condition:
RewriteCond $1 !^(index\.php|images|robots\.text|css|js);
# this is the culprit screwing everything up------------^

Get rid of that, because with it there, that condition will be true if you don't have a ; right after index.php, which you don't. And thus it rewrites to /index.php/index.php forever.

