I want to modify a
php
http
https
non-www
www
www
http
https
www
non-www
www
.hataccess
If you are using php then you need to write some conditions And you didn't give any example of sub domain IF you are going to use sub domain like de.example.com , uk.example.com then you need to redirect with the help of browser language Or you can also do it with the help of visitors locations
just like
<?php
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
if($lang=="de")
{
header('Location: https://de.example.com/');
}
?>
IN that case you need to do the followings.
1) http to https
RewriteCond %{HTTPS} !=on
2) non-www to www
RewriteCond %{HTTP_HOST} ^example.com$ [NC]
RewriteRule (.*) https://www.example.com/$1 [R=301,L]
3) www to non-www
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]