Rewrite Rule Problem

Discussion in 'General' started by zoom, Aug 12, 2008.

  1. zoom

    zoom Member

    I'm not sure if this is a LiteSpeed issue or not. I'm trying to redirect to a SSL URL if the initial request is not using HTTPS and the REQUEST_URI is /admin.php. If I use the following rewrite ruleset (see below) it seems to redirect to the first SSL site I have in my SSL template list.

    However, if I check for any other page the redirect works perfect. Any reason why it doesn't like admin.php??? Does the rule look fine?

    This ruleset doesn't work????
    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^(admin\.php)$ https://www.mydomain.com/$1 [R=301,L]

    This ruleset works perfect.
    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^(about\.php)$ https://www.mydomain.com/$1 [R=301,L]
  2. mistwang

    mistwang LiteSpeed Staff

    Maybe it your browser cache. clear the cache and try again.
  3. zoom

    zoom Member

    mistwang,
    Thanks for the reply. The problem was a mistake in the template configuration. It seems that somebody put an Apache Redirect directive for admin.php within the template. Which explains why the rewrite rule was failing to redirect correctly.

Share This Page