How can I use infinityfree with a single page application?

I’ve made a single page application with Vue and was hoping to add it here to use on my site. That’s all well and dandy for the homepage, but the second I go to another folder, such as http://mysite.com/otherpage it gives me 404 not found. Is there a way to send all requests back to index.html in the root directory, preferably without adding a .htaccess for each page?

1 Like

Nevermind, i’ve figured it out! Just adding

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.html?path=$1 [NC,L,QSA]
FallbackResource /index.html

to .htaccess worked!

5 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.