Rewrite problem

felosi

Well-Known Member
#1
Continued from email correspondence.

I tried to add the rwrite log level to httpd.conf as well as log file but neither seems to be working.

I added this in httpd.conf between the VirtualHost directives

RewriteLogLevel 9
RewriteLog /etc/httpd/logs/rw.log


The rewrite rules in question again are:
Code:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/?(.+)_(en-us|en|es|pt|de|fr|jp|it)?\.(html|htm|php$
RewriteRule ^(/)?.+ $1%1.%3?lang=%2&%{QUERY_STRING} [L]

RewriteCond %{REQUEST_URI} ^/?(en-us|en|es|pt|de|fr|jp|it)?\.(html|htm|php)$
RewriteRule ^(/)?.+ $1?lang=%1&%{QUERY_STRING} [L]

RewriteCond %{REQUEST_URI} ^/?(buy|order)_.+\.html$
RewriteRule ^(/)?buy_(.+)\.html $1?product=$2&%{QUERY_STRING} [L]
RewriteRule ^(/)?order_(.+)\.html $1?category=$2&%{QUERY_STRING} [L]

AddType application/x-httpd-php .php .htm
DirectoryIndex index.php index.htm
It doesnt work, just gives off 404 errors.

Well I think I got log issue fixed, had log level for main log wrong

Here are some errors I seen in regular log

2009-04-15 00:18:13.430 [INFO] [84.110.34.83:1419-0#APVH_indianpharmaonline.warrensdrugstore.com] [REWRITE] Rule: Match '' with pattern '^(/)?.+', result: -1
2009-04-15 00:18:13.430 [INFO] [84.110.34.83:1419-0#APVH_indianpharmaonline.warrensdrugstore.com] [REWRITE] Rule: Match '' with pattern '^(/)?.+', result: -1
2009-04-15 00:18:13.431 [INFO] [84.110.34.83:1419-0#APVH_indianpharmaonline.warrensdrugstore.com] [REWRITE] Rule: Match '' with pattern '^(/)?buy_(.+)\.html', result: -1
2009-04-15 00:18:13.431 [INFO] [84.110.34.83:1419-0#APVH_indianpharmaonline.warrensdrugstore.com] [REWRITE] Rule: Match '' with pattern '^(/)?order_(.+)\.html', result: -1
 
Last edited:

felosi

Well-Known Member
#2
Well we have tried everything. That error still showing in logs. Me and the client have no clue what we can do. Any help would be much appreciated
 

mistwang

LiteSpeed Staff
#3
Those rules does match an empty string "", the URL is an empty string when rewrite base was chopped off.
URL "/" will become "" since rewrite base is "/".
 
Top