I have a multi-language WordPress site that has been live since the last 3 months and today when I checked Analytics, I saw a lot of weird URLs:







As you can see, my domain name is coming after the end of the URL. Of course, these URLs do not exist on the site and are leading to 404 errors.

Now there is an older site from which this one was migrated and that site is still live. Could that be the problem? Also for reference here is my .htaccess:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# BEGIN WordPress
#<IfModule mod_rewrite.c>
#RewriteEngine On
#RewriteBase /
#RewriteRule ^index\.php$ - [L]
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule . /index.php [L]

# END WordPress

AddType video/mp4 .mp4 .m4v
AddType video/webm .webm
AddType video/ogg .ogv 

What exactly is happening with these URLs and how do I fix it?

  • Is Google "indexing" these urls or are they just showing up in Google Analytics as pages that people have visited? Commented Feb 8, 2013 at 6:25
  • ok good question. How do I find out if they are real as seen by analytics? Commented Feb 8, 2013 at 6:29
  • Is it possible you are dynamically building links somewhere on your site and the code building those links is incorrectly adding your FQDN to the end of the urls it is constructing instead of the begining? When you look at the raw log files for your web servers do you see any attemped requests for those urls from non google bot sources? If so do those entries have referring urls recorded for them that might help identify where these links are coming from? Commented Feb 8, 2013 at 6:31
  • 2
    @Amit: If these URLs only show up in GA, and the referrer for these requests aren't Google, and the Google bot isn't itself crawling these URLs, and you can't find these URLs in Google search results, then they're not actually indexed by Google. Commented Feb 8, 2013 at 6:51
  • 1
    That depends on how often they show up in your analytics/logs. If they're just happening this one time and you never see them again, then it's probably a fluke. If it's happening repeatedly, then maybe someone out there is linking to these broken URLs, or maybe you have broken links on some pages (e.g. you link to the domain but forgot the protocol portion of the URL). Commented Feb 8, 2013 at 7:07

5 Answers 5


It could happen if you have link like this in your template that is missing the http://

<a href="www.domain.com">

It could happen if you use your domain name in a javascript string. Some bots are known to try to crawl all javascript strings as if there were urls.

var site = 'www.domain.com';

I found your site using the allinurl: operator and google and looked through the source code for couple of the pages. I didn't find anything that resembled either of the above senarios.

It could happen if redirects from the old domain were not working in some cases. I'd think you would be able to test the redirects and find that problem.

So, I'm not sure what is causing it. If you want to fix it, you can redirect away from any url that ends in your domain name with a rewrite rule. The following will strip off the "www.domain.com" bit and redirect to a url without it.

RewriteRule (.*)www.domain.com$ $1 [R=301,L]
  • This seems like a simple enough solution Stephen. Could you tell me what you think of Sidh's evaluation above about the site being attacked through URL masking? Commented Feb 9, 2013 at 4:05
  • I've never heard of it before. Commented Feb 9, 2013 at 10:02

You can do this by doing the following steps:

  • Login to Google Analytics
  • Click admin (upper right corner)
  • Click on the profile associated with the domain that you're having an issue with.
  • Click profile settings
  • Check the "Default Page" field, if it has your domain name in there, delete it and press apply.


The Default Page field is for the index.html, index.php or similar. This field allows GA to treat http://yourdomain.com/index.php as the same page as http://yourdomain.com/.

  • This is what I tried - it worked - but it took several weeks for analytics to show the changed urls Commented Apr 4, 2013 at 4:42

I too have faced the same issue with my Wordpress sites and in Google Webmaster it appears as 404 error.

As far I got to know is, this is the case of URL masking. In short you site has been attacked.

I overcome this by reinstalling the wordpress site. Do not use any .php or any code file from previous installation. Reinstall the site through database.

  • Are you absolutely sure about this? This could take a lot of effort to execute. And what code should I use if not code files from my current installations? I don't quite understand Commented Feb 9, 2013 at 4:03
  • Use only the image files. wp-content/uploads. No config file nothing.
    – Sidh
    Commented Feb 9, 2013 at 7:08
  • could you please tell me what exactly made you sure that this was an attack? Did it destroy your data? etc Commented Feb 9, 2013 at 7:11
  • You cannot use any .php files, malicious code may have been injected in them.
    – Sidh
    Commented Feb 9, 2013 at 7:16
  • In my site, it was showing link of other sites. Some Adult site. Database is not effected.
    – Sidh
    Commented Feb 9, 2013 at 7:18

Make sure in your DNS Manager you have configured for both mydoain.com and www.mydomain.com

Normally in godaddy

@ points to --> to some Ip

www points to --> @

in aws Route 53 make sure to have entry for www like

*.mydomain.com --> Ip adresss

This is generally the A record


On your dashboard, select "Admin" which can be found on the bottom part of the main navigation.

Select "View Settings" under the View section.

Under the View Settings, you'll see "Default page" left it blank and hit Save.

Please note, previously recorded data from google analytics is final according to google. Therefore, the data that will be recorded using the corrected setting will only affect the new data and not the previous data. (Please correct me if I'm wrong)

Hope this helps.

  • Welcome to WM.SE! Please note that your answer doesn't seem to add much over the accepted answer (which was posted 6 years ago). We prefer new answers to cover something that is not already addressed. If you feel like answering questions, perhaps you could have a look at unanswered questions!
    – marcelm
    Commented Aug 19, 2019 at 10:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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