• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: problems with mod_rewrite rules
PostPosted: 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:
\$1:
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]

I rewrote the rule to include the slash in ^/(.+)html$, as without the /, the redirect resolved to  index.php?page=/home
\$1:
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


However I still get a 400 bad request when I try to acces with a clean url:
\$1:
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"

this request was correcly rewritten:
\$1:
 
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


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?


Top
   
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: problems with mod_rewrite rules
PostPosted: Tue Aug 17, 2010 7:28 am 
Offline
Forum Members
Forum Members

Joined: Wed Jul 30, 2008 7:35 pm
Posts: 10
I hate those threads that describe EXACTLY the problem you have but no solution...well here's mine: After few hours of googling and Apache/php reinstall, turned out that one slash resolved my problem  :o
\$1:
RewriteRule ^(.+).html$ /index.php?page=$1 [QSA]


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
A2 Hosting