`1. Flush and Clear Magento Cache by Command line`
```
php bin/magento cache:clean

rm -rf var/cache/*

rm -rf var/generation/*
```
`2. Enable Rewrite mod and configure htaccess file`<br>
**Modify from:**
```
<Directory /var/www/>
      Options Indexes FollowSymLinks
      AllowOverride None
      Require all granted
 </Directory>
```
**to:**
```
<Directory /var/www/>
     Options Indexes FollowSymLinks
     AllowOverride All
     Require all granted
 </Directory>
```
`3. Replace the URL`<br>
**This:**
```
http://localhost/
```
**With:**
```
http://127.0.0.1/
```
`4. Restart apache server`

I hope it helps