Hey, I’m configuring my LAMP droplet (Ubuntu 14.04) to use a simple rewrite rule in the .htaccess file and it’s simply 404-ing every time. My conf file does indeed include the “AllowOverride All” rule (see entire file below) and the .htaccess file in my web directory includes these rules:
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteRule ^([A-Za-z0-9][A-Za-z0-9][A-Za-z0-9][A-Za-z0-9][A-Za-z0-9][A-Za-z0-9])$ /index.php?i=$1 [L]
RewriteRule ^([A-Za-z0-9][A-Za-z0-9][A-Za-z0-9][A-Za-z0-9][A-Za-z0-9][A-Za-z0-9])/$ /index.php?i=$1 [L]
Conf File contents:
<VirtualHost *:80>
ServerAdmin caleb@scurrylabs.com
ServerName sqworl.com
ServerAlias www.sqworl.com
DocumentRoot /var/www/sqworl.com/public_html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory "/var/www/sqworl.com/public_html">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Any help at all would be much, much appreciated.
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!
This question was answered by @sierracircle:
some things to check:
have you enabled mod rewrite?
sudo a2enmod rewritewhat is the name of your config file? does it match your domain name? are you using the default?
do you have any other rules in your .htaccess that you can check to verify that indeed your htaccess is working?
here is one you can try…this just makes it so when you type in www.yourdomain.com it should immediately go to http://yourdomain.com
RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
I know this is old but for I had a similar problem and this was the fix that finally worked for me.
Go to /etc/apache2/apache2.conf file above and look for
<Directory /var/www/> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory>
Change “AllowOverride” from None to All
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.