When I changed AllowOverride "none" to "all" in httpd.conf - my .htaccess file started to work, but my SSL dont want to work with that...

<Directory "/var/www/html">
    Options Indexes FollowSymLinks
    AllowOverride all

Trying to get rid from www...

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.website\.com$ [NC]
RewriteRule ^(.*)$ https://website.com/$1 [L,R=301]

Then I am getting an error in browsers

Your connection is not private Attackers might be trying to steal your information from website.com (for example, passwords, messages, or credit cards). Learn more NET::ERR_CERT_COMMON_NAME_INVALID

How to fix that?

1 Answer 1


All problem was in CNAME, I wrote there IP, but it have to be "website.com."

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.