If this is happening only on server it is either because you have configured Apache to ignore .htaccess directives on your server, or because you do not have Rewrite module loaded/installed
Either you can configure the apache conf to turn on by changing in /etc/apache2/apache2.conf (location may be different depending on OS , you can of course turn it only for application directory only as well
<Directory>
...
AllowOverride None
....
</Directory>
to
<Directory>
...
AllowOverride All
....
</Directory>
for enabling rewrite module you can do ( may vary depending on OS)
a2enmod rewrite
Restart apache2 after
/etc/init.d/apache2 restart
or
service apache2 restart