.htaccess experts please read and help..

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jojojo
    Too lazy to set a custom title
    • Mar 2002
    • 2318

    #1

    .htaccess experts please read and help..

    Is it possible to detect the referring domain and re-direct the surfer somewhere else using .htaccess?

    javascript won't let me redirect and also just ignore the redirects if it comes from somewhere it's supposed to - it wants to send them to ANOTHER page...

    I just want to send surfers who click on a link to my site from a certain domain to be redirected somwhere otherwise the page would load fine...

    how do yo do this without impacting the site itself? I am hoping .htaccess

    I know it can be done using php but I have no idea how php works etc. - I need a more simplier solution :p

    thx
    Learn SEO - make $$ residually - icq me 333485092
  • Big E
    Registered User
    • Mar 2002
    • 935

    #2
    In either .htaccess or httpd.conf:

    RewriteEngine On
    RewriteCond %{HTTP_REFERER} ^http://www.somedomain.com/$
    RewriteRule ^.*$ http://www.someotherdomain.com

    Comment

    • jojojo
      Too lazy to set a custom title
      • Mar 2002
      • 2318

      #3
      thanks big E,

      can you stick this file in a certain folder and have it effect just that folder?

      and do you just repeat the line to add multiple domains to redirect from?

      thanks
      Learn SEO - make $$ residually - icq me 333485092

      Comment

      • Big E
        Registered User
        • Mar 2002
        • 935

        #4
        You can, but you've got to make sure that you've got 'Options AllowOveride' for that directory in the httpd.conf as well.

        Comment

        • Muff
          Confirmed User
          • Mar 2001
          • 1782

          #5
          migth want to add one more line to that incase traffic is sent without the www.

          not sure if it makes a difference or not.

          RewriteCond %{HTTP_REFERER} ^http://somedomain.com/$

          Comment

          Working...