Erroneous behavior with UTF-8 .htaccess

Discussion in 'Bug Reports' started by priestjim, Jan 13, 2012.

  1. priestjim

    priestjim Well-Known Member

    Hey all,

    I've been experiencing a very strange issue with a website that uses UTF-8 regular expressions in the rewrite rules:

    RewriteRule ^([0-9a-zA-Zα-ωΑ-Ω_]+)/([0-9a-zA-Zα-ωΑ-Ω_]+)/([0-9a-zA-Zα-ωΑ-Ω_]+)/([0-9a-zA-Zα-ωΑ-Ω_]+)/ index.php?ID=$1&Rec_ID=$2&var1=$3&var2=$4
    RewriteRule ^([0-9a-zA-Zα-ωΑ-Ω_]+)/([0-9a-zA-Zα-ωΑ-Ω_]+)/([0-9a-zA-Zα-ωΑ-Ω_]+)/([0-9a-zA-Zα-ωΑ-Ω_]+) index.php?ID=$1&Rec_ID=$2&var1=$3&var2=$4
    RewriteRule ^([0-9a-zA-Zα-ωΑ-Ω_]+)/([0-9a-zA-Zα-ωΑ-Ω_]+)/([0-9a-zA-Zα-ωΑ-Ω_]+)/ index.php?ID=$1&Rec_ID=$2&var1=$3
    RewriteRule ^([0-9a-zA-Zα-ωΑ-Ω_]+)/([0-9a-zA-Zα-ωΑ-Ω_]+)/([0-9a-zA-Zα-ωΑ-Ω_]+) index.php?ID=$1&Rec_ID=$2&var1=$3
    RewriteRule ^([0-9a-zA-Zα-ωΑ-Ω_]+)/([0-9a-zA-Zα-ωΑ-Ω_]+)/ index.php?ID=$1&Rec_ID=$2
    RewriteRule ^([0-9a-zA-Zα-ωΑ-Ω_]+)/([0-9a-zA-Zα-ωΑ-Ω_]+) index.php?ID=$1&Rec_ID=$2
    RewriteRule ^([0-9a-zA-Zα-ωΑ-Ω_]+)$ index.php?ID=$1
    RewriteRule ^([0-9a-zA-Zα-ωΑ-Ω_]+)/$ index.php?ID=$1

    As you can see it uses Greek characters. The case goes like this:
    - The website has a contact page that runs over the rewrite rules
    - When you perform an HTTP POST by submitting the contact form it will not open the rewritten submitted form (that is the thank you for contacting us page) but the submitting page (that is the contact form page). But, if you open the thank you page with a normal GET request, it opens fine. Please note that this is not a software issue, since the exact same files and database operate on an Apache installation as they should.

    Litespeed version is latest (4.1.10) and PHP runs over LSAPI 5.5 (5.2.17).

    Any help would be appreciated!
  2. webizen

    webizen Well-Known Member

    pls open rewrite logging to troubleshoot and see where it breaks.
  3. priestjim

    priestjim Well-Known Member

    Is this possible via .htaccess

    RewriteLog /usr/local/lsws/logs/rw.log
    RewriteLogLevel 9

    or do I need to open debug logging throught LSWS's console?
  4. webizen

    webizen Well-Known Member

Share This Page