Home Apache rewrite rule not working (Ubuntu 16.04)
Reply: 0

Apache rewrite rule not working (Ubuntu 16.04)

user964
1#
user964 Published in May 27, 2018, 3:38 am

I'm using the following .htaccess file on Ubuntu 16.04 with Apache 2.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]

I'm using that configuration to allow this PHP router to work on my website.

However, none of the defined routes appear to work correctly on my linux server (404), while they work fine on my local windows installation. This leads me to think that the htaccess isn't being interpreted properly.

What I've done:

  • Restarted apache (multiple times).
  • Enabled the rewrite mod with sudo a2enmod rewrite
  • In the site's configuration /etc/apache2/sites-available/website.com.conf, added:

    <Directory "/var/www/website.com/public_html">
    AllowOverride All
    </Directory>
    

    under my virtual host

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.308631 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO