dimanche 18 décembre 2016

htaccess redirect 301 https www to non www

Currently only the homepage is redirecting from www.example.com and example.com to https://example.com

I try to redirect:

1. http://ift.tt/2hOs6ML to http://ift.tt/2hJFAfv 
2. http://ift.tt/2hOlrSR to http://ift.tt/2hJFAfv
3. https://www.example.com to https://example.com
3. http://ift.tt/2hJzBaA to http://ift.tt/2hJFAfv

Tried to use some former questions but can't figure it out.

current state in .htaccess is:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ http://ift.tt/TfwUhn [R=301,L]
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www\.my\-domain\.com [NC]
RewriteRule ^(.*)$ http://my-domain/$1 [L,R=301]
</IfModule>

Thanks in advance




Aucun commentaire:

Enregistrer un commentaire