Operating System - Linux
1829160 Members
7130 Online
109986 Solutions
New Discussion

Help! apache mod_rewrite, seems I just can not start it

 

Help! apache mod_rewrite, seems I just can not start it

I am new bie to mod_rewrite and before I can digest the mass of the howto in regular expression, I just want to begin my mod_rewrite function as helloworld, but neither the below setting(all in the root context of httpd.conf) fail, didnt work at all.

my system is apache2.0.44, all install by one complie, the mod_rewirte inside as default.

case A:
LoadModule rewrite_module modules/mod_rewrite.so
RewriteEngine On
RewriteRule ^old\.html$ index.html [L]
RewriteLog /usr/local/apache/apache2.0.44/logs/rewrite.log

case B:
LoadModule rewrite_module modules/mod_rewrite.so
RewriteEngine On
RewriteRule ^hello\.java\.net\.nl$ http://www.java.net.nl/hello/test.jsp
RewriteLog /usr/local/apache/apache2.0.44/logs/rewrite.log

Not only it response nothing(404), but also I found nothing in the rewrite.log,too; but in the access_log, I can found the records as below:

[05/Apr/2005:23:33:23 -0400] 0 "GET /old.html HTTP/1.1" 404 206 "- -> /old.html"
192.168.0.11 - - [05/Apr/2005:23:55:43 -0400] 0 "GET / HTTP/1.1" 400 0 "- -> /index.jsp"

the behind one logged for hello.java.net.nl request, however, seems response by the behind virtualhost setting:

ServerName www.java.net.nl
DocumentRoot /home/jakarta/tomcat5/webapps/app

however, the /index.jsp is existed but do not response,too.(it is not this topic, just skipped)

I thought the mod_rewirte didnot work at all? am I right?
what I has not to do but necessary?

thanks for any tips.
Frederick van Tagero
2 REPLIES 2
Florian Heigl (new acc)
Honored Contributor

Re: Help! apache mod_rewrite, seems I just can not start it

Hey there,

I don't have very much knowledge on this module myself - but I noticed i've got it in my vhost section, You might want to give that a try.

---my config---


DocumentRoot /var/empty
ServerName justblog.blogdns.org
ErrorLog /dev/null
CustomLog /dev/null standard

RewriteEngine on
RewriteBase /
RewriteRule ^(.*)$ http://62.138.60.52:8081/$1 [QSA]



------don't ask me about it, it worked in it's days---
yesterday I stood at the edge. Today I'm one step ahead.
Ermin Borovac
Honored Contributor

Re: Help! apache mod_rewrite, seems I just can not start it

Try setting RewriteLogLevel to 9; then you should see stuff in rewrite.log. By default loging level is set to 0 so nothing gets logged. It will give a clue as to what apache does to URLs.