Redirecting a site

Discussion in 'Site & Server Administration' started by BLaZeR, May 14, 2007.

  1. #1
    Say if someone clicks one on my links from a website called lalala.com
    I want to make it so that all clicks directed to my site from lalala.com to redirect to a "go away.jpg" :p.

    Any ideas how I can do this with htacess?
     
    BLaZeR, May 14, 2007 IP
  2. trichnosis

    trichnosis Prominent Member

    Messages:
    13,785
    Likes Received:
    333
    Best Answers:
    0
    Trophy Points:
    300
    #2
    you want to redirect your old site to a jpg file ??? am i correct ???

    i think you can redirect it with meta redirect (, if i have understood correctly:p)
     
    trichnosis, May 14, 2007 IP
  3. Richie_Ni

    Richie_Ni Illustrious Member

    Messages:
    10,721
    Likes Received:
    1,175
    Best Answers:
    0
    Trophy Points:
    410
    #3
    Clicks what? Your site or...?
     
    Richie_Ni, May 14, 2007 IP
  4. BLaZeR

    BLaZeR Peon

    Messages:
    1,567
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #4
    In short, I want to make it that if you click my site link on a certain domain, you get a jpg message.
     
    BLaZeR, May 14, 2007 IP
  5. phantomddl

    phantomddl Well-Known Member

    Messages:
    2,856
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    160
    Articles:
    15
    #5
    yea possible.. add me to msn, i will try to help
     
    phantomddl, May 14, 2007 IP
  6. inworx

    inworx Peon

    Messages:
    4,860
    Likes Received:
    201
    Best Answers:
    0
    Trophy Points:
    0
    #6
    RedirectMatch permanent ^/$ http://imageblahblah.jpg
    Code (markup):
    Try it...
     
    inworx, May 15, 2007 IP
  7. BLaZeR

    BLaZeR Peon

    Messages:
    1,567
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Is that a code for all referring sites? I just want to block one.
     
    BLaZeR, May 15, 2007 IP
  8. rodney88

    rodney88 Guest

    Messages:
    480
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    0
    #8
    The only way of knowing where a visitor comes from is the HTTP_REFERER variable - this data is sent by the client so it is considered unreliable. Some visitors may have their browser setup to not send the referrer URL, or send a custom referrer of their own choice.

    The code for using mod_rewrite to check the referrer and rewrite to another location is:
    Options +FollowSymLinks
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_REFERER} ^https?://([^/]*)blockeddomain\.com
    RewriteRule .* blocked.jpg [L]
    Code (markup):
    Place it in your domain root .htaccess file (domain.com/.htaccess), change blocked.jpg to the path (from the root of the domain) to the image to show and blockeddomain\.com to the name of the domain to block.
     
    rodney88, May 15, 2007 IP