【发布时间】:2013-08-15 00:18:57
【问题描述】:
我设置了某个域以重写到一个文件夹中,如下所示,但在 Google Analytics 中一直有人出现在该文件夹中。
简而言之:/c/ -> 来自域时的 root,但 GA 仍然在访客流中显示 domain/c/
根.htaccess:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?certain-domain.com$ [NC]
RewriteCond %{REQUEST_URI} !c/ [NC]
RewriteRule ^(.*)$ /c/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
RewriteCond %{REQUEST_FILENAME}\.png -f
RewriteRule ^(.*)$ $1.png
RewriteCond %{REQUEST_FILENAME}\.txt -f
RewriteRule ^(.*)$ $1.txt
Options -Indexes
和 /c/ 的 .htaccess 只是一个编辑过的html5boilerplate one,唯一的区别是上面相同的 php 和 txt 重写。
但在 Google Analytics 上,我一半以上的访问者仍会访问 /c/index.php。
访客流量:http://i.imgur.com/JwtcTFI.png
我没有在我的 URL 中看到 /c/,所以我真的不知道发生了什么。
有什么想法吗?我确实使用了相对 URL(这是个坏主意吗?),这样会导致流程在 /c/ 文件夹中继续。
感谢您的帮助!
【问题讨论】:
标签: php .htaccess url-rewriting google-analytics