Domain pages gives error 404

My website is working well when I press on the “goto test page” button it navigates to the site with the page right. but when I go to the URL direct it navigates me to infinityfree .net/errors/404/

NB: the website is built through Flutter Web and exported as HTML

Have you got file extensions disabled? That’s the only thing I can think of causing it.

Add this to your .htaccess code:

Options +MultiViews

I didn’t disable any option on the host, but you can tell me where is exactly so I can double-check
Now, I have the line of Options +MultiViews only in htdocs\.htaccess, but still the same

Can you double check whether the test.html file exists?

Can you put that at end of your htaccess file?

RewriteEngine On
RewriteRule (.*) /index.html [L]

I assume there’s a javascript code which only changes the url on navbar but not redirect to that url itself. I don’t know if the code inside index.html can read the data after / on url.
but still, I answered you with my coding knowledge which may not be true, Maybe consider to ask your question there?


It doesn’t exsits as Flutter is a single page website (only creating index.html and the rest of files are .dart.js other that assets)

That gives internal server error 500 redirecting to, yea sure I will make an issue there thank you, just making sure it is not related to host.

mind to send a screenshot of content of your htaccess file? i think you’ve pasted it in wrong way. or try that:

RewriteEngine On
RewriteRule (.*) /index.html/$1 [L]
1 Like

here it is just your lines only

and now the website is redirecting to error 500 too

I should’ve tested the code myself before giving it to you.

<IfModule mod_rewrite.c>
Options +FollowSymlinks
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-l
    RewriteRule ^(.*)$ index.php/$1 [QSA,L]

thanks for your time. but the test page still giving error 500 but the main website is working now.

also, I tried to change .php to .html, the html one gave me error 404.

here is a screenshot of website files, if that helps

The .htaccess suggestion from @anon19508339 is correct (you need to configure the server to have it redirect all unknown URLs to the index.html file so the Flutter router can handle them), but I don’t think the provided snippet was correct.

Can you please try this one instead?

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . /index.html [L]

Thanks for you both, that did work

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