Forum Moderators: phranque

Message Too Old, No Replies

RewriteLog empty

         

Tabi

10:28 pm on Jun 1, 2010 (gmt 0)

10+ Year Member



In my WAMP environment, the mod_rewrite seems to not work correctly, and additionally the RewriteLog is empty (0 bytes), I don't know why.

My httpd.conf has these lines (among others):
LoadModule rewrite_module modules/mod_rewrite.so
Include conf/extra/httpd-vhosts.conf

The conf/extra/httpd-vhosts.conf file contains:
<VirtualHost 127.0.0.1>
DocumentRoot "F:/Personal/Documents/oskcake"
ServerName oskcake.local
RewriteLog "rewrite.log"
RewriteLogLevel 9
</VirtualHost>

(I tried also another directory: "c:/temp/rewrite.log", but no effect)

In the directory F:/Personal/Documents/oskcake there is .htaccess file with lines:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>

I type in my browser addres:
[oskcake.local...] and
[oskcake.local...]
and at least one of these addresses should result in some rewriting.. but the log is still empty.

Any idea what's wrong, why the rewrite.log is not working ?

jdMorgan

10:34 pm on Jun 1, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It is not clear from your if your problem is only related to logging, or if mod_rewrite isn't working at all.

Is there a note in your server error log?
Does it mention enabling FollowSymLinks or SymLinksIfOwnerMatch?

You only need one rule, the second one. The first is redundant when the "home page" is requested because the second rule's pattern will also accept "blank" as does the first.

Jim

Tabi

7:48 am on Jun 2, 2010 (gmt 0)

10+ Year Member



The rewrite module in my installation were working in general, because the behavior of some local adresses changed (read: stopped working) when I enabled it. Whether they are working now is unknown to me, it is possible I misconfigured something (the current configuration is in previous post). The rewrite rules came originally from CakePHP . I deleted the first rule, but nothing changed, see below.

Here is the apache_error.log from my last request [oskcake.local...]

[Wed Jun 02 08:58:41 2010] [notice] Child 5912: Released the start mutex
[Wed Jun 02 08:58:42 2010] [notice] Child 5912: All worker threads have exited.
[Wed Jun 02 08:58:42 2010] [notice] Child 5912: Child process is exiting
[Wed Jun 02 08:58:42 2010] [notice] Parent: Child process exited successfully.
[Wed Jun 02 08:58:42 2010] [warn] NameVirtualHost *:80 has no VirtualHosts
[Wed Jun 02 08:58:42 2010] [notice] Apache/2.2.11 (Win32) PHP/5.3.0 configured -- resuming normal operations
[Wed Jun 02 08:58:42 2010] [notice] Server built: Dec 10 2008 00:10:06
[Wed Jun 02 08:58:42 2010] [notice] Parent: Created child process 1276
[Wed Jun 02 08:58:42 2010] [warn] NameVirtualHost *:80 has no VirtualHosts
[Wed Jun 02 08:58:42 2010] [warn] NameVirtualHost *:80 has no VirtualHosts
[Wed Jun 02 08:58:42 2010] [notice] Child 1276: Child process is running
[Wed Jun 02 08:58:42 2010] [notice] Child 1276: Acquired the start mutex.
[Wed Jun 02 08:58:42 2010] [notice] Child 1276: Starting 64 worker threads.
[Wed Jun 02 08:58:42 2010] [notice] Child 1276: Starting thread to listen on port 80.
[Wed Jun 02 08:58:49 2010] [error] [client 127.0.0.1] File does not exist: F:/Personal/Documents/oskcake/items
[Wed Jun 02 08:58:52 2010] [error] [client 127.0.0.1] File does not exist: F:/Personal/Documents/oskcake/items

The two last lines are true, there is no such directory. However, the rewrite rules should work and redirect the request to [oskcake.local...] - but they did not. As the RewriteLogLevel is 9, there should be something in the log anyway. If I delete the log, it is re-created, so Apache sees this log, but keeps it empty.

The string FollowSimLinks or SymLinksIfOwnerMatch is not found in apache_error.log, even after restarts etc, the error log is since yesterday.

Btw, the access.log shows this:
127.0.0.1 - - [02/Jun/2010:08:58:49 +0200] "GET /items HTTP/1.1" 404 203
127.0.0.1 - - [02/Jun/2010:08:58:52 +0200] "GET /items/ HTTP/1.1" 404 204