Magento Use Web Server Rewrites Not Working At All

Magento Use Web Server Rewrites Not Working At All

September 23, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento Use Web Server Rewrites Not Working At All

The Magento “Use Web Server Rewrites” Problem: A Comprehensive Guide

You’ve set up your Digital Ocean server, installed Magento 1.8.1.0, enabled “Use Web Server Rewrites”, yet you’re still facing a 404 Not Found issue on all links. Don’t worry - we’ll troubleshoot this together step-by-step.

Step 1: Verify Your Apache Configuration

First, let’s ensure your Apache configuration is correctly set up to support Magento rewrites.

Open your Apache configuration file (usually located in /etc/apache2/sites-available/your-domain.conf or the main apache2.conf) and look for these lines:

<Directory /var/www/sitename.com/public_html/>
    AllowOverride All
</Directory>

If they’re missing, add them. The AllowOverride All setting is crucial as it enables Magento’s .htaccess rules to be executed.

Step 2: Check Your .htaccess File

Next, let’s review the default Magento .htaccess file located in /var/www/sitename.com/public_html/.

This should look something like this:

# Use a testing environment to prevent accidental changes to files.
SetEnvIf Request_URI "/downloader" NO_DOWNTIME

# 301 redirect the old index.php?r= module URL’s
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?route=$1 [L]

The RewriteEngine On line ensures that Apache will process any rewrite rules. The subsequent lines handle rewriting URLs for Magento’s front controller.

Step 3: Verify Your Document Root

Ensure your document root is correctly set to /var/www/sitename.com/public_html/.

Open the file /etc/apache2/sites-available/your-domain.conf and make sure you have a line like this:

DocumentRoot /var/www/sitename.com/public_html/

Step 4: Restart Apache

After making any changes, always remember to restart Apache for them to take effect:

sudo service apache2 restart

Common Issues and Solutions

  • RewriteBase Missing: Ensure your .htaccess file includes the RewriteBase / line at the top. This tells Apache where in the directory structure it should start looking for rewrite rules.

  • Case Sensitivity: Magento uses case-sensitive rewrites by default. If you’re getting 404 errors, try using all lowercase URLs.

  • URL Key Case: In your Magento admin panel under System > Configuration > Catalog > SEO > URL Options, ensure the “URL Key Case” is set to “lowercase”.

Conclusion

The key points to remember when troubleshooting the “Use Web Server Rewrites” issue in Magento are:

  1. Ensure Apache is correctly configured with AllowOverride All.
  2. Review and update your .htaccess file as needed.
  3. Verify your document root is set correctly.
  4. Restart Apache after making any changes.

If you’re still struggling, consider reaching out to a professional Magento development agency like Laravel Company.

Our team of certified Magento developers has years of experience in complex deployments and can help get your store up and running with minimal downtime. Don’t hesitate to contact us for expert assistance today!

Magento 1 Extensions Configuration Errors

Our network