Welcome to WebmasterWorld Guest from 54.162.139.105

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

This: ?cat=1 is appearing on end of domain name

what is causing this

     
4:29 pm on Sep 16, 2016 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:June 4, 2002
posts: 1830
votes: 3


I was using a program that tracks link and noticed ?cat=1 appearing on the end of a domain name of a site I manage. and it repeats to =4, =10 etc., so it's showing multiple copies of the home page (only the above shows up for the home page in Google but multiple links show up on the link program). All the pages are in html but only the home page appears to be affected. Can someone tell me what might be causing this? There is no database on the site and it's not a blog.

I use relative links in menu so have the index page set up like this:
<a href="/">

Here is the only reference to this site in the htaccess file.

RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
#
9:38 pm on Sept 16, 2016 (gmt 0)

Moderator from US 

WebmasterWorld Administrator keyplyr is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Sept 26, 2001
posts:10090
votes: 548


Many utilities append a parameter to the end of a web address in order to track or manage it.

Your page(s) may be in a directory, a shopping site, a link schema, etc. A bot may be validating the outgoing ling or simply following links found by crawling a site where your link appears.

There's nothing inherently malicious about a parametet being used. You'd need to investigate further to make that distinction. Look up the IP address of the agent and find out who they are.
10:31 pm on Sept 16, 2016 (gmt 0)

Administrator

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Aug 10, 2004
posts:11071
votes: 106


you should probably use a 301 redirect for those requests.

https://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewriterule
By default, the query string is passed through unchanged. You can, however, create URLs in the substitution string containing a query string part. Simply use a question mark inside the substitution string to indicate that the following text should be re-injected into the query string. When you want to erase an existing query string, end the substitution string with just a question mark. To combine new and old query strings, use the [QSA] flag.



RewriteCond %{QUERY_STRING} .
RewriteRule (.*) http://www.example.com/$1? [R=301,L]

RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule (.*) http://www.example.com/$1? [R=301,L]
12:36 am on Sept 17, 2016 (gmt 0)

Full Member

Top Contributors Of The Month

joined:Apr 11, 2015
posts: 306
votes: 21


Can someone tell me what might be causing this?


Does the "link program" not tell you from where these URLs are being linked (internal / external)? Presumably this "cat" URL parameter means nothing and is not used by your site? Otherwise it's a bit tricky for anyone to say what might be causing this, ...other than it must be being linked to from somewhere (which isn't really an Apache thing).

To prevent search engines picking this up, you can use a rel="canonical" link element in the HEAD section (or HTTP response header) to "suggest" the canonical URL. Or, if this param is wholly invalid then redirect, as phranque suggests. (But do you not use a query string anywhere on your site?)
7:18 pm on Sept 18, 2016 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:June 4, 2002
posts: 1830
votes: 3


There is no shopping cart/database on the site so there shouldn't be a query string. The page didn't have a canonical tag (due to be redesigned soon) so I'll see if that takes care of the problem.

Thanks everyone.