Php Google Analytics don';将所有子域重定向到http后无法检测子域

Php Google Analytics don';将所有子域重定向到http后无法检测子域,php,.htaccess,Php,.htaccess,我的网站使用SSL:。我需要添加一个子域,如 我将此代码添加到.htacess文件中: RewriteCond %{HTTP_HOST} ^(www\.)?example\.com$ [NC] RewriteCond %{HTTPS} off # First rewrite to HTTPS: # Don't put www. here. If it is already there it will be included, if not # the subsequent rule will c

我的网站使用SSL:。我需要添加一个子域,如

我将此代码添加到
.htacess
文件中:

RewriteCond %{HTTP_HOST} ^(www\.)?example\.com$ [NC]
RewriteCond %{HTTPS} off
# First rewrite to HTTPS:
# Don't put www. here. If it is already there it will be included, if not
# the subsequent rule will catch it.
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Now, rewrite any request to the wrong domain to use www.

RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
是的,它工作得很好。URL:是可用的。 添加此代码时有两个问题

第一个问题: 当任何用户访问URL:。Google Analytics无法从域()或子域()中检测。它发现它就像一个URL:
\
-类似域

下面是一幅容易理解的图像:

在图片中的I标记处,我试图访问,但Google Analytics detect是
/

第二个问题:-我认为问题与
.htaccess

通常,每个用户访问我的站点的时间为2-3分钟。从将此代码添加到.htaccess,访问时间约为40秒。我不知道如何将此代码添加到
。htaccess
会影响我网站上的时间视图。
我想:“不是的。”。但结果恰恰相反。子域是从我的国家的一个服务获得的视频,我认为用户可以在这里停留2分钟以上。而不仅仅是40s-1m40s。

看起来您的服务器是
nginx
而不是
Apache
。并非所有这些规则都适用。e、 g.
https://sharengay.com/
未被重定向到
https://www.sharengay.com/
@anubhava是的,我的服务器是
nginx