Magento – Magento 1.9.1 admin 404 not found

magento-1.9

I have made a migration of my e-commerce magento site 1.9.1
Since I cannot access the admin as I used to.

Before admin url was www.mydomaine.com/admin. Now that gives an error 404 not found.

To reach admin I have to hit the URL: www.mydomaine.com/index.php/admin

Can someone help me to fix it as it was before.

Thanks in advance for your help.


Edit

So indeed I was missing the .htaccess and .htaccess.sample.
Could not explain why they got cleared but they were not present.

So I imported them.

Now I get the following error: This page has a redirect loop.
And I cannot access neither front or back end 🙁

So my side is offline….

Below I changed domain name by example.

mysql> select * from core_config_data where path='web/unsecure/base_url';
+-----------+---------+----------+-----------------------+-------------------------+
| config_id | scope   | scope_id | path                  | value                   |
+-----------+---------+----------+-----------------------+-------------------------+
|         9 | default |        0 | web/unsecure/base_url | http://www.example.com/ |
+-----------+---------+----------+-----------------------+-------------------------+
1 row in set (0.01 sec)
mysql> select * from core_config_data where path='web/secure/base_url';
+-----------+---------+----------+---------------------+-------------------------+
| config_id | scope   | scope_id | path                | value                   |
+-----------+---------+----------+---------------------+-------------------------+
|        10 | default |        0 | web/secure/base_url | http://www.example.com/ |
+-----------+---------+----------+---------------------+-------------------------+
1 row in set (0.00 sec)
mysql> select * from core_config_data where path='web/url/redirect_to_base';
+-----------+---------+----------+--------------------------+-------+
| config_id | scope   | scope_id | path                     | value |
+-----------+---------+----------+--------------------------+-------+
|        73 | default |        0 | web/url/redirect_to_base | 1     |
+-----------+---------+----------+--------------------------+-------+
mysql> select * from core_config_data where path='web/seo/use_rewrites';
+-----------+---------+----------+----------------------+-------+
| config_id | scope   | scope_id | path                 | value |
+-----------+---------+----------+----------------------+-------+
|        74 | default |        0 | web/seo/use_rewrites | 0     |
+-----------+---------+----------+----------------------+-------+
1 row in set (0.00 sec)

I obviously run: rm -rf var/cache/* and rm -rf var/session/*
I also restarted apache….

Any success.

Best Answer

Better than a copy / paster here you can find the way to remove index.php from your URLs. You have to enable URL rewrite in Magento and your server.
https://stackoverflow.com/a/15504981/3531064