problems with mod_rewrite rules
Posted: Fri Mar 17, 2006 2:56 pm
Hi Forum,
The rewrite rules in docs/htaccess.txt appear not to work for my apache2 install, And I cant put the finger on why, so if anybody would be so kind to lend a hand....
Ok this is the situation:
Debian Sarge, Apache2.
In my virtualhost definition I have these rules, based on docs/htaccess:
I rewrote the rule to include the slash in ^/(.+)html$, as without the /, the redirect resolved to index.php?page=/home
However I still get a 400 bad request when I try to acces with a clean url:
this request was correcly rewritten:
The thing that annoys me the most, is that I get an error, but no error is logged, even if I turn up the reporting level.
Any ideas or should I try banging my head against a wall?
The rewrite rules in docs/htaccess.txt appear not to work for my apache2 install, And I cant put the finger on why, so if anybody would be so kind to lend a hand....
Ok this is the situation:
Debian Sarge, Apache2.
In my virtualhost definition I have these rules, based on docs/htaccess:
Code: Select all
RewriteEngine On
RewriteLog /var/log/apache2/rewrite.log
RewriteLogLevel 8
#Rewrites page.html as index.php?page
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteRule ^/(.+)\.html$ index.php?page=$1 [QSA]
Code: Select all
initial] (4) RewriteCond: input='/home.html' pattern='!-f' => matched
82.161.170.206 - - [17/Mar/2006:14:49:48 +0100] [heelsimpel.net/sid#80dc568][rid#81ef980/
initial] (2) rewrite /home.html -> index.php?page=/home
82.161.170.206 - - [17/Mar/2006:14:49:48 +0100] [heelsimpel.net/sid#80dc568][rid#81ef980/
initial] (3) split uri=index.php?page=/home -> uri=index.php, args=page=/home
82.161.170.206 - - [17/Mar/2006:14:49:48 +0100] [heelsimpel.net/sid#80dc568][rid#81ef980/
initial] (2) local path result: index.php
Code: Select all
82.161.170.206 - - [17/Mar/2006:15:02:14 +0100] "GET /fsck.html HTTP/1.1" 400 226 "http:/
/heelsimpel.net/index.php?page=fsck"
Code: Select all
82.161.170.206 - - [17/Mar/2006:15:02:14 +0100] [heelsimpel.net/sid#80dc580][rid#81ef9c0/
initial] (2) rewrite /fsck.html -> index.php?page=fsck
Any ideas or should I try banging my head against a wall?