iTorn
  • Home
  • Gists
  • Mongo Note
Subscribe
Tagged

htaccess

A collection of 4 posts

htaccess: Redirect all of your pages to be forced to use SSL
htaccess

htaccess: Redirect all of your pages to be forced to use SSL

Add this to your .htaccess file. # Redirect to HTTPS RewriteCond %{HTTPS} off RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] This should be placed directly after RewriteEngine on if you have no previous rewrites.

  • Onyx
Onyx 19 ก.ย. 2017 • 1 min read
htaccess

.htaccess - Rewrite to "domain.com -> www.domain.com"

RewriteCond %{HTTPS} !=on RewriteCond %{HTTP_HOST} !^www..+$ [NC] RewriteCond %{HTTP_HOST} (.+)$ [NC] RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]

  • Onyx
Onyx 1 มิ.ย. 2012 • 1 min read
htaccess

.htaccess - Rewrite to "www.domain.com -> domain.com"

RewriteCond %{HTTPS} !=on RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

  • Onyx
Onyx 1 มิ.ย. 2012 • 1 min read
htaccess

.htaccess - Redirect IP to Domain

Options +FollowSymLinks RewriteEngine On RewriteCond %{HTTP_HOST} ^123.456.789.091 RewriteRule (.*)$ http://www.primarydomain.com/$1 [R=301,L]

  • Onyx
Onyx 1 มิ.ย. 2012 • 1 min read
iTorn © 2022
Powered by Ghost