Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - middoweb

Pages: [1]
Apache / Redirect www to non-www (https)
« on: December 16, 2018, 10:31:14 PM »

I am trying to redirect (all websites) from www. to  non-www. and doesn`t work .
I am using :
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 :

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.

Pages: [1]