.Htaccess rules to redirect respective HTTP links to HTTP and HTTPS to HTTPS?
By : Jagat Kumar Chaudhar
Date : March 29 2020, 07:55 AM
To fix the issue you can do First, here's the .htaccess rule I currently use: code :
#if https on
RewriteCond %{HTTPS} on
RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]
#else
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]
|
htaccess rewriterule: redirect http to https or https to http (both ways) depending on URL typed
By : dkacher
Date : March 29 2020, 07:55 AM
To fix the issue you can do Try adding the following to your htaccess file in the root directory of your site. code :
RewriteEngine on
RewriteBase /
#determine if page is supposed to be http
#if it has p=home or p=home1 or qqq=home in querystring
RewriteCond %{QUERY_STRING} (^|&)(p=home1?|qqq=home)(&|$) [NC,OR]
#or if query string is empty
RewriteCond %{QUERY_STRING} ^$
#set env var to 1
RewriteRule ^ - [E=IS_HTTP:1]
#all pages that are supposed to be http redirected if https
RewriteCond %{HTTPS} on
RewriteCond %{ENV:IS_HTTP} 1
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [R,L=301]
#all other pages are sent to https if not already so
RewriteCond %{HTTPS} off
RewriteCond %{ENV:IS_HTTP} !1
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R,L=301]
|
Mod rewrite, redirect all to https except specific URI and redirect that URI from https to http
By : kls
Date : March 29 2020, 07:55 AM
I wish did fix the issue. This should do it for you. Place the most specific rule (that for /example) first. code :
RewriteEngine on
RewriteCond %{HTTPS} =on
RewriteRule ^/?example$ http://my.site.com/example [R=301,L]
RewriteCond %{HTTPS} !=on
RewriteCond %{REQUEST_URI} !^/?example$
RewriteRule ^/?(.*)$ https://my.site.com/$1 [R=301,L]
|
Redirect http to https (https works http redirects to default)
By : Andy
Date : March 29 2020, 07:55 AM
like below fixes the issue The solution was instead of *:80 on the first line, to use sub.domain.com:80.
|
htaccess to redirect all trafic from http to https but to also redirect to index.php which is hidden once on https
By : Scott B
Date : March 29 2020, 07:55 AM
it should still fix some issue I am looking for a .htaccess file which can do the following, I've managed to get each function to work individually but not together. , Try these rules: code :
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url_path=$1 [L,QSA]
|