Rewirte Conditions case sensitive

Helicon Ape provides support for Apache .htacces and .htpasswd configuration files for Microsoft IIS.
User avatar
Posts: 4
Joined: 02 Mar 2015, 15:20

Rewirte Conditions case sensitive

02 Mar 2015, 15:29

We just upgraded from ISAPI_Rewrite (Full Version) to Ape (Full Version) and got an error «Too many redirects» (ISAPI_Rewrite was uninstalled). We used following rewrite condition which works well on Apache and ISAPI_Rewrite:

RewriteCond %{HTTPS} !on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]

The rewrite rule did not match on Ape on IIS anymore because APE seems to check HTTPS case sensitive against «On». So we needed to change the rewrite rule on Ape to «On» instead of «on».

RewriteCond %{HTTPS} !On
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]

Now the rule does not work an Apache anymore. Does it makes any sense and do you have any suggestions how it works on both systems?

Thanks a lot an kind regards
Benedikt

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: Rewirte Conditions case sensitive

03 Mar 2015, 14:36

Hello, Benedikt

Please try using NS flag after your redirect rules in Ape.
Report if it helps.

User avatar
Posts: 4
Joined: 02 Mar 2015, 15:20

Re: Rewirte Conditions case sensitive

04 Mar 2015, 09:07

Thanks Anton, I will try and check the parameter ...

User avatar
Posts: 4
Joined: 02 Mar 2015, 15:20

Re: Rewirte Conditions case sensitive

04 Mar 2015, 09:18

Following syntax works on Apache:

[NC] for Not casesensitive

#Now, rewrite to HTTPS:
RewriteCond %{HTTPS} !On [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]

I will try it tomorrow on APE und IIS 8.5.

Kind regards
Benedikt

Return to Helicon Ape

Who is online

Users browsing this forum: No registered users and 46 guests