D Draft Administrator Administrator Joined Jan 23, 2011 Posts 16,492 Solutions 107 Reaction 65,372 Points 10,534 Jan 26, 2014 #1 1st Code: Rewritecond %{http_host} ^phcorner.net [nc] Rewriterule ^(.*)$ https://phcorner.net/$1 [r=301,nc] 2nd PHP: RewriteCond %{HTTP_HOST} !^www\.phcorner\.net$ RewriteRule (.*) https://phcorner.net/$1 [R=301,L] 3rd Code: RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] 4th PHP: RewriteCond %{HTTP_HOST} ^phcorner.net [NC] RewriteRule ^(.*)$ https://phcorner.net/$1 [L,R=301]
1st Code: Rewritecond %{http_host} ^phcorner.net [nc] Rewriterule ^(.*)$ https://phcorner.net/$1 [r=301,nc] 2nd PHP: RewriteCond %{HTTP_HOST} !^www\.phcorner\.net$ RewriteRule (.*) https://phcorner.net/$1 [R=301,L] 3rd Code: RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] 4th PHP: RewriteCond %{HTTP_HOST} ^phcorner.net [NC] RewriteRule ^(.*)$ https://phcorner.net/$1 [L,R=301]
D Draft Administrator Administrator Jan 26, 2014 TS TS #2 For https: 1st Code: Rewritecond %{https_host} ^phcorner.net [nc] Rewriterule ^(.*)$ https://phcorner.net/$1 [r=301,nc] 2nd PHP: RewriteCond %{https_HOST} !^www\.phcorner\.net$ RewriteRule (.*) https://phcorner.net/$1 [R=301,L] 3rd Code: RewriteCond %{https_HOST} !^www\. RewriteRule ^(.*)$ https://www.%{https_HOST}/$1 [R=301,L] 4th PHP: RewriteCond %{https_HOST} ^phcorner.net [NC] RewriteRule ^(.*)$ https://phcorner.net/$1 [L,R=301]
For https: 1st Code: Rewritecond %{https_host} ^phcorner.net [nc] Rewriterule ^(.*)$ https://phcorner.net/$1 [r=301,nc] 2nd PHP: RewriteCond %{https_HOST} !^www\.phcorner\.net$ RewriteRule (.*) https://phcorner.net/$1 [R=301,L] 3rd Code: RewriteCond %{https_HOST} !^www\. RewriteRule ^(.*)$ https://www.%{https_HOST}/$1 [R=301,L] 4th PHP: RewriteCond %{https_HOST} ^phcorner.net [NC] RewriteRule ^(.*)$ https://phcorner.net/$1 [L,R=301]