I have CentOS 5 on Linux. Apache was compiled and set up by someone else. I want to use mod_rewrite. The httpd.conf file has this: LoadModule rewrite_module modules/mod_rewrite.so I also added this: AddModule mod_rewrite.c When I restart Apache, it says Invalid command 'AddModule', perhaps misspelled or defined by a module not included in the server configuration. If I do httpd -l, it doesn't show mod_rewrite as being compiled into Apache. So, does that mean that I have to recompile apache, or is there some other way of getting the mod_rewrite to load? Thanks.
One of the following URLs will help you to enable mod_rewrite: http://www.wallpaperama.com/disp-post10.html http://www.tutorio.com/tutorial/enable-mod-rewrite-on-apache Kailash
Thank you. I have already read those and done what it says. I still get the error message when trying to restart apache.
Thanks for your reply. I had tried to enable mod_rewrite in httpd.conf, but it wouldn't allow me to restart apache, so I assumed it wasn't compiled. I am running CentOS 5.2, apache 2.2.3, which was installed with CentOS and updated via yum. I have this: /usr/lib/httpd/modules/mod_rewrite.so If I do httpd -l, it shows: Compiled in modules: core.c prefork.c http_core.c mod_so.c So, my question is, how do I recompile apache with mod_rewrite? I tried to use apxs, but it couldn't find mod_rewrite.c, so I assume that I need to install and configure from source. Should I remove the current apache via yum or rpm and then download the newest version of apache that I can configure from source with mod_rewrite, then update via yum?