Forum Moderators: phranque
Presently he uses:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ [xyz.com...] [L,R]
which redirects all http requests with www to https non-www.
However when he tries [xyz.com,...] he is prompted with a security pop-up saying domain mismatch and correct being xyz.com
Hence he would like to redirect both http and https requests made with www to non-www.
Till now I have tried all of the following methods, which do not work as required.
[By Extras modified giving me 500]
Options +FollowSymlinks
RewriteEngine On
# trailing slash fix for https
RewriteCond %{https} on [NC]
RewriteRule ^/*(.+/)?([^.]*[^/])$ [%{HTTP_HOST}...] [L,R=301]
# trailing slash fix for http
RewriteRule ^/*(.+/)?([^.]*[^/])$ [%{HTTP_HOST}...] [L,R=301]
# Force www for https
RewriteCond %{https} on [NC]
RewriteCond %{HTTP_HOST}^www\. [NC]
ReriteRule ^(.*)$ [%{HTTP_HOST}...] [L,R=301]
# Force www for http
RewriteCond %{HTTP_HOST}^www\. [NC]
ReriteRule ^(.*)$ [%{HTTP_HOST}...] [L,R=301]
[By Extras]
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST}//s%{https} ^www\.(.*)//((s)on¦s.*)$ [NC]
RewriteRule ^ http%3://%1%{REQUEST_URI} [L,R=301]
and even more.
Thanks in advance for solving my problem!
Regards
Sreekanth aka Xyris