Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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:

/menswear-fashion-autumn-winter-2013-2014/www.domain.com

/fashion-history/1960s-1970s/www.domain.com

/fashion-latest-news/www.domain.com

/it/fashion-history/1920s-1930s/www.domain.com

/fashion-history/1950s-1960s/www.domain.com

/fashion-history/1940s-1950s/www.domain.com

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]
</IfModule>

# 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]
#</IfModule>

# 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?

share|improve this question
    
Is Google "indexing" these urls or are they just showing up in Google Analytics as pages that people have visited? –  Lèse majesté Feb 8 '13 at 6:25
    
ok good question. How do I find out if they are real as seen by analytics? –  Amit Erandole Feb 8 '13 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? –  Glenn Stevens Feb 8 '13 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. –  Lèse majesté Feb 8 '13 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). –  Lèse majesté Feb 8 '13 at 7:07

3 Answers 3

up vote 2 down vote accepted

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.

Why?

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/.

share|improve this answer
    
This is what I tried - it worked - but it took several weeks for analytics to show the changed urls –  Amit Erandole Apr 4 '13 at 4:42

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]
share|improve this answer
    
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? –  Amit Erandole Feb 9 '13 at 4:05
    
I've never heard of it before. –  Stephen Ostermiller Feb 9 '13 at 10:02

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.

share|improve this answer
    
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 –  Amit Erandole Feb 9 '13 at 4:03
    
Use only the image files. wp-content/uploads. No config file nothing. –  Sidh Feb 9 '13 at 7:08
    
could you please tell me what exactly made you sure that this was an attack? Did it destroy your data? etc –  Amit Erandole Feb 9 '13 at 7:11
    
You cannot use any .php files, malicious code may have been injected in them. –  Sidh Feb 9 '13 at 7:16
    
In my site, it was showing link of other sites. Some Adult site. Database is not effected. –  Sidh Feb 9 '13 at 7:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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