Rewrite Rule Problem

zoom

Well-Known Member
#1
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]
 

zoom

Well-Known Member
#3
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.
 
Top