In other linux like CentOS, it works but i am not getting it running in Ubuntu 11.04.
/var/www/html/folder/public/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
Did you ensure the RewriteEngine is on?
You'll want to verify that the mod is enabled - just look for rewrite.load symlink in /etc/apache2/mods-enabled. If not, run
Otherwise you will need to paste more information about your .htaccess file.