vuejs-tailwindcss-portfolio icon indicating copy to clipboard operation
vuejs-tailwindcss-portfolio copied to clipboard

The app breaks 404 when switching colors

Open MoElaSec opened this issue 3 years ago • 3 comments

When deployed to Netlify try to navigate to any subpage and change the viewing mode Dark/Light and notice how the page breaks ...

MoElaSec avatar Jan 09 '22 15:01 MoElaSec

Seems like that's an issue with the Netlify itself. BTW, I have started a fix for this and will be using a different method for switching colors. It should not reload the page.

realstoman avatar Jan 16 '22 18:01 realstoman

This project is using createWebHistory mode in vue router which is recommended by vue router. This issue will raise when you will reload any page rather than the home page. To fix this issue you have to configure your server. Please check the link below https://router.vuejs.org/guide/essentials/history-mode.html

In your .htaccess add the following to fix that issue.

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

abd-abdullah avatar May 28 '22 04:05 abd-abdullah

Thank you @abd-abdullah for your contributions.

realstoman avatar May 28 '22 06:05 realstoman