# Fix page not found when refresh

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1664974427143/Qh22uIsTG.png align="left")

Sometimes when you try to deploy your front-end frameworks like ***vue.js*** or ***react.js***, your web server cannot refresh your page after you login into that page. Here are some configurations in your web server configuration

if you are using **NGINX** :

```nginx
location / {
  try_files $uri $uri/ /index.html;
}
```

if you are using **APACHE** :

make sure the *apache rewrite module* is enabled on your server, just type `sudo a2enmod rewrite`

```apache
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.html$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.html [L]
</IfModule>
```

If in ***AWS S3 bucket Config :***

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1672406871567/3f707cce-79e2-4ca5-9e58-6c03cf240912.png align="center")

If you are using AWS Cloudfront, define an error page like this

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1672407106009/ab8a64a4-0c54-4824-b480-d72fe8f4559d.png align="center")

hope this helpfull.
