Rewrite Rule Problem

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

  1. zoom

    zoom Well-Known 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)$$1 [R=301,L]

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

    mistwang LiteSpeed Staff

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

    zoom Well-Known Member

    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