How do you do this with .htaccess?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jakez
    Confirmed User
    • Jan 2004
    • 5656

    #1

    How do you do this with .htaccess?

    Let's say I am receiving traffic from a URL with various ID #'s attached to it:
    http://www.referrer.com/?id=101

    Andthe traffic is going to:
    http://www.site.com

    How do I have the .htaccess grab the ID from the referrer and do a quick redirect or something so that it will send the visitor to this instead:
    http://www.site.com/?ref_id=101
    Last edited by Jakez; 03-07-2011, 02:45 PM.
    [email protected] - jakezdumb - 573689400

    Killuminati
  • livexxx
    Confirmed User
    • May 2005
    • 1201

    #2
    how about a little bit of php, that would be easy and more controllable for v
    http://www.webcamalerts.com for auto tweets for web cam operators

    Comment

    • Jakez
      Confirmed User
      • Jan 2004
      • 5656

      #3
      Originally posted by livexxx
      how about a little bit of php, that would be easy and more controllable for v
      That's what I'm currently doing, but it likes to take forever to finally get to the page and it's probably hurting my bounce rate. htaccess seems to be a lot faster.
      Last edited by Jakez; 03-07-2011, 03:49 PM.
      [email protected] - jakezdumb - 573689400

      Killuminati

      Comment

      • woj
        <&(©¿©)&>
        • Jul 2002
        • 47882

        #4
        you are probably doing something wrong, it shouldn't take long time to load at all when done in php....
        Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
        Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
        Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager

        Comment

        • takaya
          Confirmed User
          • Mar 2003
          • 50

          #5
          try this one

          RewriteEngine on
          RewriteRule ^/?(.*) http://www.site.com/ [R=301,L,QSA]

          Comment

          • Jakez
            Confirmed User
            • Jan 2004
            • 5656

            #6
            Originally posted by woj
            you are probably doing something wrong, it shouldn't take long time to load at all when done in php....
            Would it slow it down much if I'm doing an htaccess redirect and then another one in PHP? Kinda another reason why I just want to have it all in htaccess. I have htaccess redirecting mysite.com/string to mysite.com/page.php, so that I can change the htaccess at any time and have it redirect many links at once to where ever I want, then mysite.com/page.php grabs the ID query from the referrer and redirects to mysite.com/page.php?ref_id=101
            [email protected] - jakezdumb - 573689400

            Killuminati

            Comment

            • woj
              <&(©¿©)&>
              • Jul 2002
              • 47882

              #7
              Originally posted by Jakez
              Would it slow it down much if I'm doing an htaccess redirect and then another one in PHP? Kinda another reason why I just want to have it all in htaccess. I have htaccess redirecting mysite.com/string to mysite.com/page.php, so that I can change the htaccess at any time and have it redirect many links at once to where ever I want, then mysite.com/page.php grabs the ID query from the referrer and redirects to mysite.com/page.php?ref_id=101
              need to do it all at once, either all in php, all or all in .htaccess... 2 separate redirects are not a good idea...
              Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
              Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
              Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager

              Comment

              • takaya
                Confirmed User
                • Mar 2003
                • 50

                #8
                Originally posted by takaya
                try this one

                RewriteEngine on
                RewriteRule ^/?(.*) http://www.site.com/ [R=301,L,QSA]
                This shit will append query string to site.com. It works on my end

                Comment

                • Chris
                  Too lazy to set a custom title
                  • May 2003
                  • 27880

                  #9
                  wrong thread .. edit.
                  [email protected]

                  Comment

                  • Jakez
                    Confirmed User
                    • Jan 2004
                    • 5656

                    #10
                    Originally posted by takaya
                    This shit will append query string to site.com. It works on my end
                    I tried but it didn't seem to work. I probably have too much crap going on with this for that to work correctly idk.

                    I did manage to get what I need all in 1 with the following:
                    RewriteRule ^string/?_(.*)$ http://www.site.com?id=$1 [QSA]

                    So site.com/string_101 will now goto site.com/?id=101, didn't know I could dynamically add zone ID's in Juicy
                    Last edited by Jakez; 03-07-2011, 04:44 PM.
                    [email protected] - jakezdumb - 573689400

                    Killuminati

                    Comment

                    • fris
                      Too lazy to set a custom title
                      • Aug 2002
                      • 55679

                      #11
                      Originally posted by Jakez
                      Let's say I am receiving traffic from a URL with various ID #'s attached to it:
                      http://www.referrer.com/?id=101

                      Andthe traffic is going to:
                      http://www.site.com

                      How do I have the .htaccess grab the ID from the referrer and do a quick redirect or something so that it will send the visitor to this instead:
                      http://www.site.com/?ref_id=101
                      Code:
                      RewriteEngine on
                      Options +FollowSymLinks
                      RewriteCond %{HTTP_REFERER} !^http://(.+\.)?referrer\.com/ [NC]
                      RewriteCond %{QUERY_STRING} ^id=([^&]+)$
                      RewriteRule ^(.*) http://site.com/?ref_id=%1 [L]
                      this should work.
                      Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

                      Comment

                      • fris
                        Too lazy to set a custom title
                        • Aug 2002
                        • 55679

                        #12
                        tested it on a site, works fine
                        Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

                        Comment

                        • Dappz
                          Confirmed User
                          • Dec 2009
                          • 997

                          #13
                          i use this .htaccess to secure my sites


                          Hentai Artist * Draw My Anime *
                          HentaiLovers * hentaiG4H * ICQ : 657458

                          Comment

                          Working...