apache - Combine two htaccess rules to one -
i have 2 rules
- redirect http https
- redirect website.com www.website.com
i want combine them 1 rule, because 2 redirects each time 2 rules when go mywebsite.com, first redirect https, second redirect https:/www
here 2 rules:
rewritecond %{https} off rewritecond %{request_uri} !^/[0-9]+\..+\.cpaneldcv$ rewritecond %{request_uri} !^/\.well-known/pki-validation/[a-f0-9]{32}\.txt(?:\ comodo\ dcv)?$ rewriterule ^(.*)$ https://%{http_host}%{request_uri} [l,r=301] rewritecond %{http_host} . rewritecond %{http_host} !^www\. [nc] rewritecond %{request_uri} !^/[0-9]+\..+\.cpaneldcv$ rewritecond %{request_uri} !^/[a-f0-9]{32}\.txt(?:\ comodo\ dcv)?$ rewritecond %{request_uri} !^/\.well-known/pki-validation/[a-f0-9]{32}\.txt(?:\ comodo\ dcv)?$ rewriterule ^ http%{env:protossl}://www.%{http_host}%{request_uri} [l,r=301]
Comments
Post a Comment