WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] stop spammers using ?ref=domain.com (11 posts)

  1. selimkoc
    Member
    Posted 7 years ago #

    I have read about how to stop referer spam, and my website is suffering from Tiklasana.Net and arabulursun.net (spammers).

    But I want to add a rewrite rule for all those spammers who use ?ref term. I dont have any affiliation or any referer website. So I want to redirect all urls which start with mydomain.com/?ref=something or mydomain.com/mycatergory/?ref=something

    I tried to add url redirects such as

    redirect 301 /?ref=Tiklasana.Net http://www.mydomain.com
    redirect 301 /?ref=arabulursun.net http://www.mydomain.com
    redirect 301 /?ref=Tiklasana.Net%20Arama http://www.mydomain.com

    but it did not work. I think question mark and equal characters may have different reprezentations when writing redirect rules.

    I also looked at anti-referer spam plugins, but I think htaccess is easy, because plugings need to modify php files, and you have to do it when you upgrade wordpress.

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    What does "?ref=blah" have to do with the referer? What is "referer spam"? What are you trying to do?

    Your question makes no sense whatsoever.

  3. rudolf45
    Member
    Posted 7 years ago #

    because plugings need to modify php files

    Who said that? I've never seen any antispam plugin that modified my WP files.

  4. shimon
    Member
    Posted 7 years ago #

    Akismet is my best friend.

  5. Kahil
    Member
    Posted 7 years ago #

    Yes, Akismet works great! Also consider Bad Behavior and a captcha plugin. I use such a combination and no longer have a spam problem. Yes, the spammers still come to my site and try, but thats as far as it goes.

    Good luck!

  6. selimkoc
    Member
    Posted 7 years ago #

    google this

    site:japonya.org ref

    what you will see is a spam. so I want to remove this files, even some of them already has a google pagerank.

    if you google

    site:japonya.org you may saw 20 indexed pages, other pages are omitted.

    I dont have a comment spam problem, so I dont need akismet.

    Thanks for you advices

  7. pizdin_dim
    Member
    Posted 7 years ago #

    I have to admit that I'm a bit confused how your situation impacts anything. WP doesn't recognise the "ref" variable in the URI, so how is the referrer relevant? Why do you think it's spam? Do you think Google uses the "ref" variable?

    EDIT: Ok, I see what you mean now. Wikipedia explains it pretty well. But how did you find out that Google uses a field called "ref" when indexing and then taking it to represent referrer?

  8. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    I'm still not following this, unfortunately. This "ref" is not the referrer. The referrer is part of the http header information. The referrer spam you're talking about on wikipedia is when a site publishes their referrer logs, so hits to a site with a fake referrer create links on that site. This "ref" does nothing at all.

    That said, the best way to clean up your site in Google is to publish a Google sitemap.

  9. selimkoc
    Member
    Posted 7 years ago #

    I am really confused, why you did not understand this problem.

    First of all, I have google sitemap, and I update it regularly. you can see it http://www.japonya.org/sitemap.xml

    So although my sitemap do not include

    http://www.japonya.org/?ref=turkeylist.net
    http://www.japonya.org/?ref=Tiklasana.Net%20Arama
    http://www.japonya.org/?ref=arabulursun.net

    and other three spam urls in google sitemap, or anywhere in my website. Google indexed these pages.

    What is problem is, wordpress shows my index page when you hit these spam urls. So, I think, google thinks that this is content duplication. Because I have one real index page, and 6 spam urls, which shows the same index page.

    What I want to do is remove all this spam urls. And I also want wordpress to show an error page when somebody try to access http://www.mysite.com/?ref=something .

    There is a only one updated plugin for this, but it requires to add some php code to index.php of wordpress and a couple of other installation requirements.

    What I am really asking for is: a rewrite or redirect rule for my htaccess file which will do

    if (someone requests = http://www.mydomain.com/?ref=X ) then show file not found error

    and if (someone requests =www.mydomain.com/?ref=already_indexed_spam_url) then 301 redirect it to http://www.mydomain.com

    I dont know about htaccess files, rewrite rules, but I tried a couple of examples which I found on the net, but they made my website unaccessible. So if there is someone who knows how to write the query for htaccess file which (I think) I explained above, it could be helpfull.

  10. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    Oh... Well, if all you want to do is that...

    RewriteCond %{THE_REQUEST} \?(ref=.*)?\ HTTP [NC]
    RewriteRule .? http://example.com%{REQUEST_URI}? [R=301,L]

    Why didn't you say so in the first place? ;-)

    This doesn't discriminate based on what the referrer actually is, like you suggested above though. It just removes the ref variable and sends the 301 redirect to the URL without it. This will have the effect of eliminating these extra results from Google (a 301 redirect is a permanent redirect, and Google will update it's URL to eliminate the ?ref= stuff), which is what I assume you want.

    I did test this on my own site. It works for me.

  11. selimkoc
    Member
    Posted 7 years ago #

    thanks a lot,

    it works also for me.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags