homepage Welcome to WebmasterWorld Guest from 54.227.56.174
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld

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
jamie




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

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




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

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

hakre




msg:1499180
 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.

gbaker123




msg:1499181
 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
</Directory>

George

jamie




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

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




msg:1499183
 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

<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

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