0

I am working an a small REST API with FlightPHP, and having an issue with the URL Rewriting. It is working fine on my development machine, but when I deploy it to production I am getting 404s for all routes other than the base '/' route. The 404 is not the typical FlightPHP 404, but the Apache/Ubuntu 404

This is what I have in the .htaccess:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [QSA,L]

I know .htaccess/mod_rewrite is enabled, because I also have a couple of WordPress sites hosted on this machine (a Linode VPS)

Any ideas?

  • There's no need for `QSA`, because you don't add a query string. Apart from that it looks fine. Maybe a `RewriteBase` issue, the error.log might tell you more. – Olaf Dietsche Feb 27 '17 at 15:03
  • Is this a new site? mod_rewrite is a module that's enabled server wide, however if you configure vhosts for each site you still have to enable `.htaccess` for each one. It's not automatic. `AllowOverride All` – Panama Jack Feb 27 '17 at 15:50
  • tried adding this to apache2.conf with an apache restart with no luck. Options Indexes FollowSymLinks AllowOverride All Require all granted –  Feb 27 '17 at 17:49

0 Answers0