I’d like to have:
http://example.comredirect to:http://www.example.comhttps://example.comredirect to:https://www.example.com
And anything that is http://whatever.example.com NOT append the www like http://www.whatever.example.com.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Try this rule:
Here’s an explanation:
onandoff) ands(so eitheronsoroffs) is equal toonsand captures thes. This means if%{HTTPS}sevaluates toons, the first matching group issand empty otherwise.^) and redirects them to the evaluated value ofhttp%1://www.%{HTTP_HOST}%{REQUEST_URI}if both conditions are true. Where%1is the first matching group of the previous condition (sif HTTPS and empty otherwise),%{HTTP_HOST}is the HTTP Host of the request and%{REQUEST_URI}is the absolute URL path that was requested.