1

I have a dedicated server (Apache+Nginx (as proxy reverse) and php-fpm , mod-rewrite is activated), I host many domains and in one specific domain I want all requests to https://domain.com. I have tried many solutions and all theme but none worked for me.

Please give me a complete code to put in .htaccess to redirect The following:

domain.com
www.domain.com
https://www.domain.com  

To:

https://domain.com
vard
  • 4,057
  • 2
  • 26
  • 46
Mani
  • 199
  • 2
  • 12

1 Answers1

1

you need write this:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^domain.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301]
Matt Clark
  • 27,671
  • 19
  • 68
  • 123
Dofri
  • 126
  • 4