logo
down
shadow

Htaccess redirect https to another https


Htaccess redirect https to another https

By : Prathyusha
Date : November 21 2020, 09:01 AM
I wish this help you You cannot match scheme http:// in RewriteCond %{HTTP_HOST}.
You can use this rule:
code :
RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC]
RewriteRule ^ https://www.domain.com%{REQUEST_URI} [R=302,L]


Share : facebook icon twitter icon
.htaccess redirect to new domain with path intact for both www and non-www as well as https and non https

.htaccess redirect to new domain with path intact for both www and non-www as well as https and non https


By : 梁汇林
Date : March 29 2020, 07:55 AM
I wish did fix the issue. You just need this single rule in the DOCUMENT_ROOT/.htaccess file of olddomain:
code :
RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www\.)?olddomain\.com$ [NC]
RewriteRule ^ http://%1newdomain.com%{REQUEST_URI} [R=301,L,NE]
Redirect Domain1 to HTTP non-www to HTTPS www - Domain2 without HTTPS htaccess

Redirect Domain1 to HTTP non-www to HTTPS www - Domain2 without HTTPS htaccess


By : user2716695
Date : March 29 2020, 07:55 AM
will be helpful for those in need I've a multistore with Opencart. Domain1 uses HTTPS and domain2 uses HTTP. I've the following settings in my .htaccess because I want both domains redirecting to HTTP(S)://www. , You can use these 2 rules:
code :
RewriteEngine On

## domain1 ##
RewriteCond %{HTTP_HOST} ^(www\.)?domain1\.nl$ [NC]
RewriteCond %{HTTP_HOST} !^www\. [NC,OR]
RewriteCond %{HTTPS} off
RewriteRule ^ https://www.domain1.nl%{REQUEST_URI} [L,R=301,NE] 

## domain2 ##
RewriteCond %{HTTP_HOST} ^(www\.)?domain2\.nl$ [NC]
RewriteCond %{HTTP_HOST} !^www\. [NC,OR]
RewriteCond %{HTTPS} on
RewriteRule ^ http://www.domain2.nl%{REQUEST_URI} [L,R=301,NE]
htaccess to redirect all trafic from http to https but to also redirect to index.php which is hidden once on https

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]
htaccess redirect domain to https, subdomain to https and non-www to www

htaccess redirect domain to https, subdomain to https and non-www to www


By : Sullie
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , I’m looking to do this: , You can use that in your root .htaccess:
code :
RewriteEngine on 

# redirect to https www
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^(?:www\.)(domain\.com)$ [NC]
RewriteRule ^ https://www.%1%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP_HOST} ^(domain\.com)$ [NC]
RewriteRule ^ https://www.%1%{REQUEST_URI} [R=301,L]

# redirect to http subdomain
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^((?!www).+\.domain\.com)$ [NC]
RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
RewriteEngine on 

# redirect no-www to www only main domain, not with subdomain
RewriteCond %{HTTP_HOST} ^(domain\.com)$ [NC]
RewriteRule ^ https://www.%1%{REQUEST_URI} [R=301,L]

# redirect http to https all domain
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
.htaccess: Redirect main domain to https://www, subdomain to https:// (without www)

.htaccess: Redirect main domain to https://www, subdomain to https:// (without www)


By : Dmitry Vedmed
Date : March 29 2020, 07:55 AM
Hope that helps I know there is an endless number of provided .htaccess-solutions around here, but none of them redirects to https with www only for main domain, but to https without www only for subdomains. Based on this question with a solution via php, now I want to modify my .htaccess-file to fulfill the following needs. , The rule is duplicated for subdomain part, you should modify to this:
code :
RewriteCond %{HTTP_HOST} ^www\.subdomain\.domain\.com$ [NC]
RewriteRule ^ https://subdomain.domain.com%{REQUEST_URI} [R=301,L,NE]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Related Posts Related Posts :
  • piwik tracker status 500 installation error
  • Redirect root of subdomain, not the folders
  • Remove .htpasswd protection from a subfolder
  • Redirect loop using Apache mod_rewrite (clean URLs)
  • dot in url returns 404 error (.htaccess)
  • Refresh URL on custom 404 error page
  • insecure image breaking the green SSL bar
  • How to switch between two Apache installations?
  • Apache virtal hosts unreachable
  • Redirect substring of URL using .htaccess
  • htaccess restrict authentification but exception on file
  • Puppet apach::vhost ssl_cert, ssl_key are not being created
  • IP Blacklisting Apache
  • Apache Error Log spammed with an error
  • RedirectMatch with excluding URLs?
  • 301 redirection in htaccess not working
  • Effects of increasing timeout limit in Apache
  • How do I redirect just my home page?
  • Receiving 404 error after setting up mod_rewrite
  • Apache redirect to a clean URL
  • Apache FOP embedded, how to use config file
  • Play framework: Secure WebSocket with Apache
  • SVN Redirect cycle
  • Remove hardcoded urls from htaccess rewriterules
  • Solr Query Exact Match and partial match search Querying
  • shadow
    Privacy Policy - Terms - Contact Us © animezone.co