Forum Moderators: phranque
i'm on apache 1.3.2 and redhat 7.2.
httpd -l:
Compiled-in modules:
http_core.c
mod_so.c
suexec: enabled; valid wrapper /usr/sbin/suexec
so i wish to compile in the mod_rewrite.so module (amongst others).
I add the line:
LoadModule rewrite_module /usr/lib/apache/mod_rewrite.so
to my httpd.conf, and can restart apache ok. but when i try a simple .htaccess (this file already works) rewrite, nothing happens, and i get no errors either.
.htaccess:
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^index2\.html$ index3.html [R=301,L]
i thought it might have been the missing line from the httpd.conf:
AddModule mod_rewrite.c
but when i restart apache after adding this line, i get the following warning in my error_log:
[warn] module mod_rewrite.c is already added, skipping
much appreciate any help.
thanks all but unfort. no joy.
i don't know whether this applies, but i did say in the first post that the .htaccess file already works to deliver a custom 404 page, to limit access and parse .html pages for ssi.
however, i added the following lines to httpd.conf
<Directory /usr/local/apache/sites>
AllowOverride All
</Directory>
but it made no difference. and httpd -l still gives me:
Compiled-in modules:
http_core.c
mod_so.c
suexec: enabled; valid wrapper /usr/sbin/suexec
still confused, surely after adding the LoadModule lines to the httpd.conf, httpd -l should also list mod_rewrite.c?
i am sure i have not loaded the mod_rewrite correctly. i have also made no reference to the mod_rewrite.c file in the httpd.conf as apache didn't like that (see first post)
many thanks
i actually have two apache webservers on my machine (gorufu spotted that), and i was httpd -l'ing the wrong one. the correct one does have mod_rewrite already compiled in, so i had to comment out the LoadModule line and add
<Directory....>
AllowOveride All
Options All
</Directory>
now looking in error logs i find that the the rewrite would work but the paths are wrong, it is looking in /usr/local/apache/sites/mydomain.com/htdocs/usr/local/apache/sites/mydomain.com/htdocs - one full path to many.
cheers