<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>www on Tutes Club</title><link>https://tutes.in/tag/www/</link><description>Recent content in www on Tutes Club</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Fri, 27 Jul 2018 06:10:09 +0000</lastBuildDate><atom:link href="https://tutes.in/tag/www/index.xml" rel="self" type="application/rss+xml"/><item><title>.htaccess redirect from http to https and from non-www to www redirect – Make site permanently SSL secured</title><link>https://tutes.in/htaccess-redirect-from-http-to-https-and-from-non-www-to-www-redirect-make-site-permanently-ssl-secured/</link><pubDate>Fri, 27 Jul 2018 06:10:09 +0000</pubDate><guid>https://tutes.in/htaccess-redirect-from-http-to-https-and-from-non-www-to-www-redirect-make-site-permanently-ssl-secured/</guid><description>&lt;p&gt;put this in your htaccess file:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;RewriteCond %{HTTP_HOST} !^www\.(.*)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;RewriteRule (.*) https://www.%{HTTP_HOST}/$1 [R=301,L]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;RewriteCond %{HTTPS} !=on
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Forcing website to https and www using htaccess on apache servers</title><link>https://tutes.in/forcing-website-to-https-and-www-using-htaccess-on-apache-servers/</link><pubDate>Wed, 21 Feb 2018 17:45:20 +0000</pubDate><guid>https://tutes.in/forcing-website-to-https-and-www-using-htaccess-on-apache-servers/</guid><description>&lt;p&gt;To first force HTTPS, you must check the correct environment variable %{HTTPS} off, but your rule above then prepends the www. Since you have a second rule to enforce www., don’t use it in the first rule.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;RewriteCond %{HTTPS} off
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# First rewrite to HTTPS:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Don&amp;#39;t put www. here. If it is already there it will be included, if not
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# the subsequent rule will catch it.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Now, rewrite any request to the wrong domain to use www.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# [NC] is a case-insensitive match
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;RewriteCond %{HTTP_HOST} !^www\. [NC]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item></channel></rss>