大网数据广告活动
网站运营与故障问答

Why do my analytics report that index.php appears in URLs despite friendly URL rewrite rules?

· 52CE 我爱测

On a website i use mod_rewrite and PHP to create clean URL's. My .htaccess (summary) will look like that shown below: RewriteEngine On #oude pagina's RewriteRule ^nl/links/(.*)/index.php$ /nl/links/$1/ [L,R=301] RewriteCond %{REQ…

问题原文

原帖链接 · Bass Jobsen · CC BY-SA 4.0

On a website i use mod_rewrite and PHP to create clean URL's.

My .htaccess (summary) will look like that shown below:

RewriteEngine On

#oude pagina's
RewriteRule     ^nl/links/(.*)/index.php$    /nl/links/$1/ [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([a-zA-Z]{2}/[a-zA-Z0-9/\-_]+)/$ /index.php?navid=$1&%{QUERY_STRING} [L]

When using a browser the above seems to work well

/nl/links/eropuit/vakantie/rondreizen/ shows the right content, and /nl/links/eropuit/vakantie/rondreizen/index.php redirects to /nl/links/eropuit/vakantie/rondreizen/

But when i take a look at the most visited pages at Google Adsense (Analytics), it tells me a index.php is found for every URL:

Now I wonder why that index.php is found / detected and whether I should worry about it.

已采纳解答

原帖链接 · Reve · CC BY-SA 4.0

Google Analytics provides a way to add a filename to any page path ending with a slash, in order to standardize data for pages that might be accessible with or without the filename. Look in Admin > View Settings for the Default Page field, right underneath time zone. An index.php in that field is your reason!

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2019-11-12)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。