I
I
Ivan Kashmir2015-11-25 15:23:25
htaccess
Ivan Kashmir, 2015-11-25 15:23:25

Why doesn't redirect https://www.site.com to https://site.com work?

Can't redirect https://www.site.com to https://site.com . Permanently adds www
Do this:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^\/?(.*)$ https://site.com/$1 [R=301,L ]

Everything works on this service. htaccess.madewithlove.be

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Tokmakov, 2015-11-27
@NPC

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

Everything should work

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question