So I'm setting up SVN on my home server (Ubuntu 9.1), and want the ability to view any changes made to my CodeIgniter app immediately.
So, my working copy lives in /home/myname/environments/development/appname.
My Vhost is accessible at dev.appname.myname.ca, and the config looks like this:
DocumentRoot /home/myname/environments/development/
ServerName dev.myname.ca
ServerAlias dev.*.myname.ca
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.* [NC]
RewriteCond %{HTTP_HOST} ^dev.([^\.]+)\.myname\.ca
RewriteCond /home/myname/environments/development/%1/trunk/ -d
RewriteRule ^(.*) /%1/trunk/public/$1
So, going to dev.appname.myname.ca would point to /home/myname/environments/development/appname/trunk/public.
Now, this being a CodeIgniter app, I need to redirect all requests from public/ to public/index.php, so the .htaccess file in public/ is as follows:
RewriteEngine On
RewriteCond $1 !^(index\.php)
RewriteRule ^(.*)$ index.php/$1 [L]
I have this part in an .htaccess file because on a live production site, I won't have access to the server config so I'd need to override it.
The problem is now that I'm getting a loop of redirects and ultimately a 500 error.
From /var/log/apache2/error.log:
redirected from r->uri = /appname/trunk/public/index.php/appname/trunk/public/index.php/appname/trunk/public/index.php/appname/trunk/public/index.php/appname/trunk/public/index.php/appname/trunk/public/index.php/appname/trunk/public/index.php/
How can I redirect the request to the proper public/ directory (in this case, /home/myname/environments/development/appname/trunk/publc) and THEN direct all requests from public/ to public/index.php?
I know it's a long-winded question - thanks for your help. :)