Flutter web 404 Not Found

175
RewriteCond %{REQUEST_FILENAME}% !-d
RewriteCond %{REQUEST_FILENAME}% !-f

You have an erroneous literal % at the end of the TestString argument, so these negated conditions will always be successful, including when the request is rewritten to /index.html.

These conditions should be written:

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f

But note that for requests to the document root to be correctly rewritten you need to ensure that the DirectoryIndex is correctly set. For example:

DirectoryIndex index.html
Share:
175
dinesh balan
Author by

dinesh balan

Updated on January 02, 2023

Comments

  • dinesh balan
    dinesh balan over 1 year

    Flutter Web after deploy in server 404 will appear I know flutter is single page application so we configure the .htaccess file

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

    but I use one static html file render in app so this method is not working ​and also I tried 404.html. No use please help me

    • MrWhite
      MrWhite over 2 years
      What URL are you requesting?