Welcome to WebmasterWorld Guest from 54.234.63.187

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

mod rewrite probs - apache

not compiled in, and can't get it to work

     

jamie

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

WebmasterWorld Senior Member 10+ Year Member



hi,

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.

DaveAtIFG

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

WebmasterWorld Senior Member 10+ Year Member



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

hakre

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

WebmasterWorld Senior Member 10+ Year Member



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

gbaker123

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

10+ Year Member



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
</Directory>

George

jamie

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

WebmasterWorld Senior Member 10+ Year Member



hi,

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

jamie

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

WebmasterWorld Senior Member 10+ Year Member



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

<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

 

Featured Threads

Hot Threads This Week

Hot Threads This Month