I migrate magento2 windows system to linux system with database. Home page of magento2 is working fine but other page is give error 404 not found. If I add index.php in frontend url then it's opening but without it not possible. And also magento admin is also not opening even after adding index.php in url.
Did you see AllowOverride All? This is a commonly overlooked step. Please see:
The problem was in my Apache server configuration the below procedure helped me solving this problem
For Ubuntu edit the file /etc/apache2/apache2.conf (here we have an example of /var/www)
<Directory /var/www/> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory>
and change it to;
<Directory /var/www/> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory>
sudo service apache2 restart