homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

mod rewrite probs - apache
not compiled in, and can't get it to work

 8:04 am on Feb 22, 2003 (gmt 0)


i'm on apache 1.3.2 and redhat 7.2.

httpd -l:
Compiled-in modules:
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.

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.



 2:46 pm on Feb 22, 2003 (gmt 0)

Check the "Allow Override [httpd.apache.org]" directives.


 2:50 pm on Feb 22, 2003 (gmt 0)

and if you get a 500 internal server error, you can check error.log for more details on it.


 11:59 am on Feb 24, 2003 (gmt 0)

Yes allow override is likely what you need. I had the same problem and had to add it.

Here's an example

<Directory "/home/od/www">
AllowOverride ALL



 1:33 pm on Feb 24, 2003 (gmt 0)


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

but it made no difference. and httpd -l still gives me:

Compiled-in modules:
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


 8:05 am on Feb 25, 2003 (gmt 0)

you were all on the right track ;-)

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

AllowOveride All
Options All

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.


Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved