mod_rewrite problems

I am confused as to why my mod_rewrite appears to be improperly installed. Hope someone can help me with this one.

Currently when I go to /etc/httpd/conf/httpd.conf file it appears modrewrite is enabled as I see the following line: "LoadModule rewritemodule modules/mod_rewrite.so". It is not commented out. Additionally, "AllowOverride" is set to "All"

When I go to the modules directory, "mod_rewrite.so" is indeed there

However, when I execute "/usr/sbin/httpd -l | grep modrewrite", it apparently is not installed as the expected modrewrite.c output does not appear.

Additionally, when I attempt to implement a simple .htaccess file with mod_rewrite, it does not work.

Any help is appreciated.

4 Replies

Additionally, when I execute "/usr/sbin/httpd -M" this appears in the output: "rewrite_module (shared)"

Did you install apache from a tarball or from your distro's repository? In most distros I've worked with, you need to explicitly allow .htaccess files. Try something like this:

 <directory path="" to="" document="" root="">AllowOverride All</directory> 

Thanks, I have already set "AllowOverride" to "All" for the document root.

I am using CentOS 5 and did indeed install Apache via my distro's repository.

@bpaw:

Thanks, I have already set "AllowOverride" to "All" for the document root.

I am using CentOS 5 and did indeed install Apache via my distro's repository.

I assume you've checked the error log.

Jim

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct