Po wpisaniu:
# remove www from url
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1%{REQUEST_URI} [L,R=301]
# redirect to https://
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} !^localhost
RewriteCond %{HTTP_HOST} !^127.0.0.1
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
się zesrało.
[pid 2315333:tid 47466334582528] [client 83.xx.xx.xx:0] /home/mojatajnadomena/public_html/.htaccess: Invalid command '\xef\xbb\xbf', perhaps misspelled or defined by a module not included in the server configuration
Wpisałem te drugie:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://sample.mydomain.com/$1 [R,L]
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
I to samo. Skasowałem to z HTTS i strona i tak nie działa rzucając błędem: 500.