Author Topic: Redirect www to non-www (https)  (Read 4615 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Redirect www to non-www (https)
« on: December 16, 2018, 10:31:14 PM »
Hi!

I am trying to redirect (all websites) from www. to  non-www. and doesn`t work .
I am using :
Quote
Nginx & Apache
Additional Options: php-cgi/suphp, nginx/php-fpm, apache/php-fpm, proxy
HTTP: Nginx (80) --> Apache (8181)
HTTPS: Nginx (443) --> Apache (8181)

htaccess code :

Quote
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]

Anyone can tell me what´s the corect way ? thanks.

« Last Edit: December 16, 2018, 10:44:47 PM by middoweb »
www.MiddoWeb.com - web services.
www.SysAdmin20.com - sysadmin 2.0

Offline
*
Re: Redirect www to non-www (https)
« Reply #1 on: December 23, 2018, 09:51:50 PM »
upp
www.MiddoWeb.com - web services.
www.SysAdmin20.com - sysadmin 2.0