Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems using mod_rewrite

Status
Not open for further replies.

colpaarm

Programmer
Jun 30, 2003
29
0
0
US
Hi guys. I have rh 9.0 and am running apache 1.3.27. I want to force all connections to my webserver to be https and read that mod_rewrite works well in this instance. After messing with my httpd.conf file, I finally got my webserver to recognize my .httaccess file (before it was just ignoring it). However, rewrites don't work.

Specifically, I get an internal server error as soon as I even try and include the line

RewriteEngine on

with the message being

Invalid command 'RewriteEngine', perhaps mis-spelled or defined by a module not included in the server configuration

So I did some more research and realized that I have to load the module to use it (kinda makes sense, right?). So I included the following three lines

LoadModule rewrite_module modules/mod_rewrite.so
ClearModuleList
AddModule mod_rewrite.c

When I try to restart apache, I get

Syntax error on line 479 of /usr/local/apache/conf/httpd.conf:
Cannot load /usr/local/apache/modules/mod_rewrite.so into server: /usr/local/apache/modules/mod_rewrite.so: cannot open shared object file: No such file or directory

So I did a locate for mod_rewrite.so and found it under /usr/lib/httpd/modules. So I changed the load statement to

LoadModule rewrite_module /usr/lib/httpd/modules/mod_rewrite.so

That gave me

Syntax error on line 479 of /usr/local/apache/conf/httpd.conf:
Cannot load /usr/lib/httpd/modules/mod_rewrite.so into server: /usr/lib/httpd/modules/mod_rewrite.so: undefined symbol: apr_pool_cleanup_null
./apachectl startssl: httpd could not be started

I also tried using the first loadmodule statement and placing a sym link which gave me the second error. Does anybody know what's up? I installed apache from tarball and I have DSO support. Thanks in advance.
 
I compile my Apache with the very capable assitance of

My mod_rewrite method of redirecting to https appears as follows:

RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) [L,R]

I DO NOT HAVE any forced module install/load commands as you have listed above in my 'httpd.conf' or any file in /usr/local/apache/conf/ I don't think you compiled mod_rewrite. It probably is not a default module.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top