Report this

What is the reason for this report?

.htaccess doesn't work on ubuntu droplet

Posted on May 5, 2015

I installed LAMP on my droplet and then I followed this tutorial: https://www.digitalocean.com/community/tutorials/how-to-set-up-mod_rewrite and I used the contents for the file from my old web hosting, so I know it works: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ $1.php [L,QSA]

However, if I enter for example http://cyan.red/index it comes up with: Not Found

The requested URL /index was not found on this server.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

You know this command $ a2enmod rewrite is not mentioned in any DO tutorial, but without it I couldn’t enable .htaccess, now can, thanks

This thread was very helpful. It did the trick for me. Thanks to everyone! :)

None of this worked for me. What did work was to enable “AllowOverride all” in the apache2.conf file in /etc/apache2. For me it was on line 172 of that file. I tried everything else to eliminate my pages from giving a 404 when visiting pages but the homepage.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.