I am using codeigniter and also have just installed a light stack with an ubuntu 10.10 cloud server.

Things are working great, and that i possess the apache userdir module enabled to ensure that home directory sits at /home/myapp/public_html, and that i can get on by visiting servername/~myapp.

Unfortuntely, .htaccess' rewrite doesn't appear to become working - it leads to a 404 saying "the file /home/myapp/public_html/index.php" couldn't be located - a 404 error.

Mod_rewrite is enabled.

I am aware you need to set the AllowOverride All directive - i've it occur /etc/apache2/sites-enabled/default - yet rewrite does not appear to become working correctly.

My .htaccess file simply consists of:

RewriteEngine on
RewriteCond $1 !^(index.php|img|stylesheets|js|icons|robots\.txt|user_guide)
RewriteRule ^(.*)$ index.php/$1 [L]

And my /etc/apache2/sites-available/default appears like:

<VirtualHost *:80>
ServerAdmin dan@danmatthews.me

DocumentRoot /var/www
<Directory />
      Options FollowSymLinks
      AllowOverride ALL
<Directory /var/www/>
      Options Indexes FollowSymLinks MultiViews
      AllowOverride ALL
      Order allow,deny
      allow from all
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
      AllowOverride All
      Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
      Order allow,deny
      Allow from all

ErrorLog ${APACHE_LOG_DIR}/error.log

And lastly, /etc/apache2/mods-enabled/userdir.conf appears like:

<IfModule mod_userdir.c>
        UserDir public_html
        UserDir disabled root

        <Directory /home/*/public_html>
                AllowOverride All
                Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
                <Limit GET POST OPTIONS>
                        Order allow,deny
                        Allow from all
                <LimitExcept GET POST OPTIONS>
                        Order deny,allow
                        Deny from all

I have been searching and fiddling for hrs, can anybody help please?

For which it's worth, I'd a really similar trouble with Ubuntu Server 11.10 and Light. I needed to run the command

sudo a2enmod rewrite

which have been effective for me personally. It can be the answer for you personally as well as other people arriving here.