Remove index.php from url in magento
Solution for ubuntu
* Enable rewrite mod for apache by command "a2enmod rewrite"
* sudo vim /etc/apache2/sites-available/default
* change AllowOverride None to AllowOverride All in this file
* sudo vim /etc/apache2/sites-enabled/000-default
* change AllowOverride None to AllowOverride All in this file
* sudo vim /var/www/magento/.htaccess
* change RewriteBase / to RewriteBase /magento/
* now restart apache sudo /etc/init.d/apache2 restart