-1

I want to forward request like this

http://www.website.com/ > https://www.website.com/ > https://website.com/

My .htaccess:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
</IfModule>
RavinderSingh13
  • 130,504
  • 14
  • 57
  • 93
Muhammed
  • 9
  • 3

2 Answers2

1

Try :

RewriteCond %{HTTP_HOST} !^website\.com$
RewriteRule ^ https://domain\.com [R=301,L]
1

Based on your shown samples, try. Please make sure you clear your browser cache before testing your URLs. Make sure you are placing your https rule at the top of your htaccess file.

<IfModule mod_rewrite.c>
RewriteEngine ON
RewriteBase /
RewriteCond %{HTTP_HOST} ^(?:www\.)(.*)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [NE,R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
RavinderSingh13
  • 130,504
  • 14
  • 57
  • 93