- Joined
- Jan 23, 2011
- Posts
- 16,380
- Solutions
- 106
- Reaction
- 65,053
- Points
- 10,470
1st
2nd
3rd
4th
Code:
Rewritecond %{http_host} ^phcorner.net [nc]
Rewriterule ^(.*)$ https://phcorner.net/$1 [r=301,nc]
PHP:
RewriteCond %{HTTP_HOST} !^www\.phcorner\.net$
RewriteRule (.*) https://phcorner.net/$1 [R=301,L]
Code:
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
PHP:
RewriteCond %{HTTP_HOST} ^phcorner.net [NC]
RewriteRule ^(.*)$ https://phcorner.net/$1 [L,R=301]