
Originally Posted by
Millie63
... In awstats however, both addon domains show as subdomains of the primary domain - but I guess this doesn't matter much as only I see the awstats. ... I read somewhere that I should probably have [R301] redirects for both the addon domains to redirect subdomain.primarydomain.com to domain.com (i.e artwebsite.ecl.com to artwebsite.com) for SEO reasons. What's your take on this?
...
Unless another.domain.tld is linked to, most SEs will never see another.domain.tld (only the add-on domain's name). But to be on the safe side one could redirect all requests to a specific FQDN (Fully Qualified Domain Name). Keep in mind Zen Cart will only generate links using the defined values of HTTP_SERVER and HTTPS_SERVER (which should contain the desired FQDNs).
Code:
###############################################################################
# Enable mod_rewrite processing using the rules in this .htaccess file
###############################################################################
# Notes:
#
# For mod_rewrite to work, the Apache server option to allow symbolic links to
# be followed must be enabled. Most providers supporting mod_rewrite will
# already have it enabled for you, but if your rewrite rules are not working
# you can un-comment the first directive below to manually enable the option.
#
# Don't forget, mod_rewrite directives are processed in order until a matching
# RewriteRule with the [L] flag is encountered. So the more specific a rule is
# the closer it should appear to the top of this file.
#
# These directives should only appear once in the .htaccess file
###############################################################################
#Options +FollowSymLinks
RewriteEngine on
###############################################################################
# Redirect to the desired FQDN if the request was not for the desired FQDN
###############################################################################
# Notes:
#
# This utilizes a HTTP/301 response. Any POST data will be discarded.
###############################################################################
RewriteCond %{HTTP_HOST} !host\.domain\.tld$ [NC]
RewriteRule ^.*$ http://host.domain.tld%{REQUEST_URI} [R=301,QSA,L]
###############################################################################
# Remove "zencart" if present from the request URI
###############################################################################
# Notes:
#
# Some servers add a leading slash "/" and others do not. This rule attempts
# to handle both, but one may need to alter this by hand on some servers.
###############################################################################
RewriteCond %{REQUEST_URI} ^/?zencart/
RewriteRule ^(/?)zencart/(.*)$ $1$2
###############################################################################
# CEON URI Mapping
###############################################################################