.htaccess - Forcing users to access the site with www. and https -


I am trying to write an .htaccess rule that connects to www and https if necessary, in HTTPS , But I can not get a set of rules or rules that works for each case.

There are cases ...

\ - just work should be done

\ - should go

\ - / P>

\ - - should go

Any help greatly appreciates.

Try this rule:

  RewriteCond% {HTTPS} ! [OR]% {HTTP_HOST} on RiverCount! ^ Www. RewriteCond% {HTTP_HOST} ^ (www \.)? (. +) Rewariyitium ^ https: //www.%2% {REQUEST_URI} [L, R = 301]  

This should cover both cases where either the request HTTPS (first Condition) or host www (second condition) does not start with. In that situation, the third condition starts with host www (if present), which is then used in the replacement of the rule.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -