Checking URL bar

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • markgodley
    New Member
    • May 2010
    • 2

    Checking URL bar

    Hey,

    Im having a problem with web proxys and fake orders. I have a method of blocking these.

    Ive noticed all the webbased ones add the url onto the end of their site
    i.e www.webproxy.co m/292ijsjsksks_ww w.mysite.com

    Is there a way to check the URL begins with my site i.e www.mysite.com

    if it doesnt redirect them to another site i.e google.com
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Hey.

    If that is the URL you are being sent, you could try to check the Host header of the request. It may reflect the host of the proxy rather than your site. - You would be best off using your HTTP server for that, though.

    For example, using Apache and mod_rewrite, you could try:
    [code=htaccess]<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond ${HTTP_HOST} !example.com
    RewriteRule .* http://google.com/ [L,NC]
    </IfModule>[/code]
    Where example.com is the actual domain you want to be used.

    Note, thought, that it is often impossible to tell whether a proxy is being used. It's not unless the proxy reveals itself, using something like the HTTP_X_FORWARDE D_FOR header, or if you manage to find the IP on a list of known proxies, that you are able to identify it.

    Comment

    • markgodley
      New Member
      • May 2010
      • 2

      #3
      thanks. So where abouts would i insert that code? im only used to dealing with php

      Comment

      Working...