mod_rewrite failing to redirect, instead getting 404s – Apache 2

I’ve been trying to set up mod_rewrite on a newish, fairly clean install of Apache 2, on Ubuntu 8.04. However, whenever I test the URL-to-be-redirected, I get a 404.

I ran a2enmod rewrite and a2enmod proxy; as far as I can tell, they were successful – my mods-enabled directory contains proxy.conf, proxy.load, and rewrite.load.

My vhosts file includes this:

DocumentRoot /var/www/saveplay
<Directory /var/www/saveplay>
    Options FollowSymLinks
    AllowOverride All

and my .htaccess file is in the relevant directory. (It’s currently owned by www-data; it didn’t work when it was owned by root either.) It looks like this:

Options +FollowSymLinks

RewriteEngine On

RewriteRule ^/koolaid$  [R=301]

I am sure there is something desperately stupid and simple that I am missing, but my google-fu is failing me.


If you are just redirecting everything at /koolaid to a new location couldn’t you just use the following in your .htaccess?

Redirect 301 /koolaid

Source : Link , Question Author : bhaibel , Answer Author : runlevelsix

Leave a Comment