There is an error with the 3rd set of rules. Here's the solution: with the 3rd set of rules: if https is "on", then if the URL does not contain "/ secure", then redirect to http.
# Rewrite Rules for domain.com RewriteEngine On RewriteBase /
Unsuccessful tip: please look for Yahoo Slow with your very smart site optimization tips and you'll see why it's always better to have a www before. You better do the opposite for your rewrite rule # 1: if there is no "www", add it.
Try using the RewriteLog directive: this will help you identify such problems:
# Trace: # (!) file gets big quickly, remove in prod environments: RewriteLog "/web/logs/mywebsite.rewrite.log" RewriteLogLevel 9 RewriteEngine On
Tell me if this works.
source share