Take the 2-minute tour ×

Recently, I was doing .htaccess url rewrite, make all my php url into html, in some page, the logout button wont work properly. for example, in page ‘quotedetails/Q9999.html’ (rewrited from ‘quotedetails.php?quoteID=Q9999′), when I click logout button in this page, it wont do the trick, but when i use the old php url of this page, it works again, other rewrited pages like index.html (index.php), search.html(search.php), all works perfectly.

I use firebug to debug, after I click the logout button, it stays in the same page without redirect me to the index.html, but I saw the the ‘logoff’ params has been passed through, but just dont let me logout and redirect to index page. I’ve changed all the relavent file path to absolute path, still no luck…..help please.

I’ve also noticed from firebug, that page cannot get the redirect ‘location’ as I tried in other pages, their response headers come with ‘location: index.html’, but in that no-workin-page, there is no such line called ‘location: index.html’ in its response headers.

Here is my .htaccess file, no-workin-pages are related to the first four ReweiteRules

Options +FollowSymlinks
RewriteEngine on

RewriteRule ^reps/all,all.html$ rep.php?repID=all&repName=all   
RewriteRule ^reps/([A-Z]+),([A-Za-z\sA-Za-z]+).html$ rep.php?repID=$1&repName=$2
RewriteRule ^reps/([A-Za-z]+),([A-Za-z\sA-Za-z]+),([0-9]+).html$ rep.php?repID=$1repName=$2&page=$3
RewriteRule ^quotedetails/(Q[0-9]+).html$ quotedetails.php?quoteID=$1

RewriteRule ^index.html$ index.php   
RewriteRule ^addquote.html$ addquote.php   
RewriteRule ^search.html$ search.php   
RewriteRule ^viewall.html$ viewall.php   
RewriteRule ^howto.html$ howto.php   
share|improve this question

1 Answer 1

up vote 2 down vote accepted

Could it be you are doing the logout using a command like ?logout=yes and the query string is not passed through?

If that is the case, try adding [QSA] to each rule:

RewriteRule ^index.html$ index.php  [QSA]

From the manual (emphasis mine):


Consider the following rule:



share|improve this answer
thank you, you saved my day! [QSA] works! –  Patrick Jun 10 '10 at 7:41

Your Answer


