.htaccess - Redirect https://www.example.com to https://example.com -


i have no knowledge of writing htaccess scripts . :(

so , want redirect https://www.example.com "https://example.com" .

i have registered "example.com" , not "www.example.com" ca .

this present script :

rewriteengine on rewritecond %{https} off rewriterule (.*) https://%{http_host}%{request_uri}  rewritecond %{http_host} ^www\.(.*)$ [nc] rewriterule ^(.*)$ http://%1 [r=301,l] 

thanks !

if don't have www.example.com in certificate, you'll never able redirect without getting security warning. ssl handshake performed before request ever sent server. means mod_rewrite never see request unless browser accepts certificate exception.

you need purchase certificate handles both "www" , without.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -