Forum Moderators: phranque

Message Too Old, No Replies

Redirect, Tried over 20 methods and failed

         

xyris

2:28 pm on Jul 22, 2006 (gmt 0)

10+ Year Member



I would like to have one of my client's website perform a redirect as mentioned below since he only has an SSL for xyz.com and not for www.xyz.com

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

whoisgregg

4:21 pm on Jul 25, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's not possible to have an SSL certificate for the root domain name. It requires a fully qualified domain name (FQDN) which is of the form subdomain.rootdomain.tld.

rootdomain.tld isn't enough.

(Wild cards are the exception, but I doubt is the case here.)