Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

657
Views
Flutter web 404 without hash on apache no htaccess

I'm trying to enable direct url handling on my Flutter app. I am using beamer and the app works as expected with deep linking within an app emulator, and when using the chrome web browser emulator through vscode.

When I publish the code though, only the main page works. Directly accessing the url doesn't.

When I switch back to the /#/ strategy, everything works and I can access anywhere in the app directly.

This means that the app is not loaded and only the Apache webserver is returning a 404 because it does not recognize index.html of the flutter jS file to be a cgi.

Awhile back I worked with php and there was a way to access url's without using extensions and an override in httpd.conf setting.

Has anyone got this working for flutter navigation 2.0 compiled for web on an apache webserver?

Thanks

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

create a .htaccess file in the root directory:

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.html [L]
</IfModule>

Edit httpd.conf for that root directory:

DocumentRoot "/Users/myname/myapp/build/web"
<Directory "/Users/myname/myapp/build/web">
          Options FollowSymLinks
          AllowOverride All
          Order allow,deny
          allow from all
</Directory>

Visit: yoursite.com/path/to/flutter/page or wherever you have a route parser

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!