Associated Domain in Webstats
In my Umami webstats I show my associated (addon) domains.
So in some stats I see domain1.com and then domain1.com.maindomain.com
It also showed me domain1.com and www.domain1.com
I manged to make a .htaccess file to forward all www to the non www.
On associated domains it gets trickier though because I have a couple of hundred of them sharing the same folder and using the same index file. In my webstats though I can see which domain takes the hits but I also see a number of the domains twice. Once regular and once as a subdomain of the master.
I cannot figure out how to set the htaccess file to get the associated domains (technically subdomains) to forward to the domain.
Anyone got any ideas?
-
Hey there! There aren't tools in cPanel to manage this, so you'll need to manually setup any redirects that you want to happen.
I will say that our team is looking into ways to keep the extra subdomain associated with addon domains from being indexed in search engines, which would likely help with your situation as well, and I've added your experience to that case.
0 -
Yeah its too bad, I counted and I actually have over 500 domains in the same folder so the webstats are way bigger than they should be showing a lot of domains with their subdomains so I have to add the two together to get an accurate count.
I removed all the www's with one entry and was hoping to do the same with the subdomains
RewriteOptions inherit
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]0 -
Also working on this for the subdomains but it looks like it still needs a tweak
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^(?!www\\.)([^.]+)\\.domain\\.com$ [NC]
RewriteCond %{REQUEST_URI}::%1 !^/([^/]+).*?::\\1
RewriteRule ^(.*)$ /%1/$1 [L]0
Please sign in to leave a comment.
Comments
3 comments