Oct 11, 2011
tom

mod_rewrite is not being enabled?

Question

I have php 5.3.8, apache 2.2.21, all is good, except mod_rewrite

by default LoadModule rewrite_module modules/mod_rewrite.so is enabled (not commented out)

ClearModuleList does not exist

AddModule mod_rewrite.c does not exist

and then you have

<Directory />
    Options FollowSymLinks
    AllowOverride All
</Directory>

still i test mod_rewrite and it’s not working, what more should i do?? if it wasn’t for .htaccess i would have used nginx, by the way apache was installed by default when i got the vps and then i updated it but that didn’t change the httpd.conf settings

do you think i should uninstall it and reinstall it by myself??? everyone say that mod_rewrite should not be enabled by default so i don’t know why my apache is different

Answer

Redirect directive belongs to mod_alias, not mod_rewrite.

To test the mod_rewrite, put the belows in .htaccess file in document root:

RewriteEngine On
RewriteRule (.*) http://google.com [R=301,L]

Make sure that you set AllowOverride All in <Directory "/document/root">

Related posts:

  1. How do I enable mod_rewrite on Apache??? It looks like it’s enabled but it’s not working
  2. Apache mod_rewrite not working
  3. apache/mod_rewrite not configured properly?
  4. Mod_rewrite (CakePHP routing functionality) forbidden after Snow Leopard upgrade
  5. .htaccess enabled, but not working

Leave a comment