0

.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, [email protected] 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/bigmeow.com/blog/.htaccess: RewriteLog not allowed here, referer: http://bigmeow.com/blog/linuxcmd/?p=68  

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

2 Answers 2

5

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

http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html#rewritelog

1
  • but i have no priviledge to modify /etc/http.conf and /etc/httpd/vhost.conf:( Aug 16, 2012 at 16:49
2

You need to put it in your httpd.conf, see here:
http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html#rewritelog

Context: server config, virtual host

You cannot put it in a .htaccess.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .