Need a rewrite for a continued 404 error from scammer

Discussion in 'Apache' started by bluffspot, Jul 29, 2012.

  1. #1
    Hell and I hope someone can help. My site is continually getting spammers trying to register (and there is no registration) the same info keeps being used and I am trying to figure a way to stop it and redirect them.

    This is what they are trying to get to: /profile.php?mode=register

    Yes I have a forum on my site but it is a subdomain. So this link would not exist on the main site.

    I have tried to do a 301 redirect in .htaccess but it does not seem to work. I think it is due to the "?" in the link. Anyone have an idea how to redirect these people?
     
    bluffspot, Jul 29, 2012 IP
  2. shteca

    shteca Active Member

    Messages:
    145
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    78
    #2
    I have this same problem.

    I keep getting users trying to access /vendershare on my server.
    I do not have this file.
    I just set up a 404 redirect to a personalised 404.php page.
     
    shteca, Sep 1, 2012 IP
  3. shindig

    shindig Peon

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Ok, Apache's redirect commands ignore query strings. You'll need to use rewrite commands to get it to work:


    RewriteEngine On 
    RewriteCond %{REQUEST_URI}  ^/profile\.php$ 
    RewriteCond %{QUERY_STRING} ^mode=register$ 
    RewriteRule ^(.*)$ http://mydomain.site/new-page [R=301,L]
    
    Code (markup):
     
    shindig, Sep 2, 2012 IP