My webhost originally set up my site with 2 different names: one with and one without the www. I asked him to please make them both with the www, which he has now done. However, now when I find links in Yahoo or Google or wherever with the websiteA.com, they are getting the can't find server message.
Safari can’t open the page “h**p://websiteA.com/animals/mammal1/mammal1.html” because Safari can’t find the server “websiteA.com”.
I thought the htaccess redirect would correct this, but it is not. Is there something wrong with my coding (shown below)?
# Externally redirect certain non-canonical hostnames to canonical hostname, preserving http/https protocol
# FQDN-format www.websiteA.com or with appended port number
RewriteCond %{HTTP_HOST} ^www\.websiteA\.com(\.|\.?:[0-9]+)$ [NC,OR]
# Non-www websiteA.com
RewriteCond %{HTTP_HOST} ^websiteA\.com [NC,OR]
# www- or non-www websiteB.com
RewriteCond %{HTTP_HOST} ^(www\.)?websiteB\.com [NC,OR]
# www- or non-www site2\.hostsite\.com hostname
RewriteCond %{HTTP_HOST} ^(www\.)?site2\.hostsite\.com [NC]
RewriteCond %{SERVER_PORT}s ^(443(s)|[0-9]+s)$
RewriteRule ^(.*)$ http%2://www.websiteA.com/$1 [R=301,L]