I inadvertently (stupidly) have created links from one part of my site to another without making sure the link used the correct URL that included the www. My site has two sections. One is all html and the other is osCommerce. When i created a URL link to the osCommerce section, I forgot to make sure the link shows the www and so it is going to the osCommerce portion as domain.com/osc instead of www.domain.com/osc. Can I fix this in htaccess or do I have to go and fix all those links to include the www? Here is my current htaccess redirect instructions:
# Externally redirect certain non-canonical hostnames to canonical hostname, preserving http/https protocol
# FQDN-format www.domainA.com or with appended port number
RewriteCond %{HTTP_HOST} ^www\.domainA\.com(\.|\.?:[0-9]+)$ [NC,OR]
# www- or non-www domainB.com
RewriteCond %{HTTP_HOST} ^(www\.)?domainB\.com [NC]
RewriteCond %{SERVER_PORT}s ^(443(s)|[0-9]+s)$
RewriteRule ^(.*)$ http%2://www.domainA.com/$1 [R=301,L]
Domain B is a different name entirely, so it would just concern Domain A, one with www and one without. Should I add this:
# www- or non-www domainA.com
RewriteCond %{HTTP_HOST} ^(www\.)?domainA\.com [NC,OR]
- Jeannie