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:

enter image description here

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

  • 1
    Is that Google AdSense or Google Analytics? Google AdSense has reporting about which pages on your site it shows advertisements on, so that report could be from it, but it looks more like a report from Google Analytics to me. Nov 12, 2019 at 14:08
  • 1
    You are presumably linking only to the "clean" canonical URL throughout your site and sitemap etc.?
    – MrWhite
    Nov 12, 2019 at 14:37
  • 3
    Have these URLs with index.php ever existed (as public facing URLs)? Do these URLs appear in client-side JS? Are there any inbound links to these URLs? If these URLs have never been referenced publicly (and they have always successfully redirected) then Google shouldn't "find it". Is there a physical index.php file on your system in these places? If the redirect wasn't in place would that URL return the same response?
    – MrWhite
    Nov 12, 2019 at 23:52
  • 3
    It is possible for GA to add the index.php. If you look at Admin > View Settings is anything filled into Default Page? (right underneath time zone)
    – Reve
    Nov 15, 2019 at 20:27
  • 2
    Are you using the standard GA tracking code to record pageviews? Not some custom script that might be looking at the filename instead of the URI? Nov 16, 2019 at 16:58

1 Answer 1


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!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.