Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

.htaccess worked well at first, then I added two lines to my .htacess to enable RewriteLog. The result is that I failed to open my web site.

The two lines I added to my .htaccess are as follows:

RewriteLog /home/bigmeow/mylog/rewrite.log
RewriteLogLevel 9

.htaccess with rewritelog enabled is as follows:

less .htaccess
RewriteEngine On
RewriteBase /blog/
RewriteLog /home/bigmeow/mylog/rewrite.log
RewriteLogLevel 9
RewriteRule ^index\.php$ - [L]

# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
RewriteRule . index.php [L]

The error message I get when I try to open my web site:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. 

The error message I get from error.log:

[Thu Aug 16 08:55:16 2012] [alert] [client xx.xx.xx.96] /home/bigmeow/ RewriteLog not allowed here, referer:  

What I should do if I want to make RewriteLog work well?

share|improve this question
up vote 5 down vote accepted

You cannot add RewriteLog to .htaccess as you can see below. If you want to set RewriteLog you must add this to server config or virtual host config.

RewriteLog Directive
Description:    Sets the name of the file used for logging rewrite engine processing
Syntax:         RewriteLog file-path
Context:        server config, virtual host

share|improve this answer
but i have no priviledge to modify /etc/http.conf and /etc/httpd/vhost.conf:( – giantforest Aug 16 '12 at 16:49

You need to put it in your httpd.conf, see here:

Context: server config, virtual host

You cannot put it in a .htaccess.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.