Forum Moderators: phranque

Message Too Old, No Replies

Mod_Rewrite doesn't work

problems in apache configuration in httpd.conf

         

Deep

10:49 am on Sep 22, 2004 (gmt 0)

10+ Year Member



Hi,
I am playing around with this mod_rewrite thing for a while now but it does not work on my local server but same thing works on other server..

I upgraded apache to 1.3.31 on Redhat linux 7.2 using following commands..

./configure --prefix=/path/to/apache --enable-module=so --enable-module=rewrite --enable-shared=rewrite

make

make install

it worked fine..

it installed apache without any errors..

now in httpd.conf i added these 2 lines for the first time..

LoadModule rewrite_module libexec/mod_rewrite.so

AddModule mod_rewrite.c

(I did not find mod_rewrite.so in apache tar installation file so I copied file from old pre-installed version of apache [1.3.23] to libexec directory)

and restarted the apache..it worked without any errors...

it showed mod_rewrite module under Apache Modules option in Webmin

so after all these i removed that AddModule line from httpd.conf, i started with simple mod_rewrite rule...but it showed me page cannot be displayed error

here is what i had written in the rule (in .htaccess file)

Options +FollowSymLinks

RewriteEngine on

RewriteRule id(.*)\.htm$ id.php?id=$1

i.e. id.php?id=5 --> id5.htm

I checked the same code by uploading it to the server online..and it worked fine...

Can any of these problems could be problem..

1. I used mod_rewrite.so from older version of apache, if that can be reason then how to get so file for latest version? (is it something like when i add mod_rewrite.c in httpd.conf it will automatically generated so file or something?)

2. there is no mod_rewrite.o file in the modules directory under apache_dir/src/modules/standard/, i found mod_rewrite.c and mod_rewrite.h there. (for other modules .o files were present with .c files)

3. I could not find mod_rewrite module under Re-Configure Known Modules in WebMin (other modules were present there)

any ideas about this problem?

Regards
Deep

Deep

7:15 am on Sep 24, 2004 (gmt 0)

10+ Year Member



Hi,
I sorted it out...
there was some problem with the installation...but now everything seems to be fine..

Deep