Anyone interested in learning some mod_rewrite?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hornycash
    Confirmed User
    • Jun 2002
    • 2336

    #1

    Anyone interested in learning some mod_rewrite?

    Heya!

    Yes, i got it mod_rewrite was one of the big secrets for me
    but now, i figured it out and wanna share my new knowledge
    (it's not really deep but enough to set up something) with you
    guy's

    so come on, let's share something
  • - Jesus Christ -
    Confirmed User
    • Mar 2003
    • 7197

    #2
    "i figured it out"



    You can do almost anything with mod_rewrite (except manupulate the contents of files)
    its like a programming language.

    Amen

    Comment

    • Why
      MFBA
      • Mar 2003
      • 7230

      #3
      i have lots of stuff already setup using mod_rewrite. its pretty cool shit.

      Comment

      • Weppel
        Confirmed User
        • Aug 2003
        • 2190

        #4
        Show me, i'm always willing to learn

        Comment

        • fuzebox
          making it rain
          • Oct 2003
          • 22367

          #5
          mod_rewrite rocks

          I'm curious, if you don't know how to use mod_rewrite, how else do you guys control your hotlinking?

          Comment

          • hornycash
            Confirmed User
            • Jun 2002
            • 2336

            #6
            Originally posted by - Jesus Christ -
            "i figured it out"



            You can do almost anything with mod_rewrite (except manupulate the contents of files)
            its like a programming language.
            i know. for me it's interesting for SE-Optimization.
            i'll program PHP, Java, VB, VB.net & Perl for about 5
            Years but never ever do something with mod_rewrite

            im happy that it works and wanna share this with
            other peoples who may have the same starting
            problems... a chatboard can be helpful

            Comment

            • Trafficbrokercom
              Confirmed User
              • Dec 2002
              • 542

              #7
              http://www.engelschall.com/pw/apache/rewriteguide/

              Comment

              • - Jesus Christ -
                Confirmed User
                • Mar 2003
                • 7197

                #8
                Originally posted by hornycash


                i know. for me it's interesting for SE-Optimization.
                i'll program PHP, Java, VB, VB.net & Perl for about 5
                Years but never ever do something with mod_rewrite

                im happy that it works and wanna share this with
                other peoples who may have the same starting
                problems... a chatboard also can be helpful
                Its hard stuff to learn. Defianlty glad you found a new tool. I just thougt it was funny how you said you figured out its big secret.

                Amen

                Comment

                • Weppel
                  Confirmed User
                  • Aug 2003
                  • 2190

                  #9
                  Originally posted by Trafficbrokercom
                  http://www.engelschall.com/pw/apache/rewriteguide/
                  Gonna print that one for later reference, thanks.

                  Comment

                  • Weppel
                    Confirmed User
                    • Aug 2003
                    • 2190

                    #10
                    Originally posted by hornycash


                    i know. for me it's interesting for SE-Optimization.
                    i'll program PHP, Java, VB, VB.net & Perl for about 5
                    Years but never ever do something with mod_rewrite

                    im happy that it works and wanna share this with
                    other peoples who may have the same starting
                    problems... a chatboard can be helpful
                    What SE optimalisation can be done with mod_rewrite? Couldn't think of anything to be honest..

                    Comment

                    • - Jesus Christ -
                      Confirmed User
                      • Mar 2003
                      • 7197

                      #11
                      Originally posted by Weppel


                      What SE optimalisation can be done with mod_rewrite? Couldn't think of anything to be honest..
                      Anytime you have a string with more than 2 variables most engines wont follow the link. It allows you to run scripts behind the illusion of everything being an html file.

                      Amen

                      Comment

                      • hornycash
                        Confirmed User
                        • Jun 2002
                        • 2336

                        #12
                        Originally posted by Weppel


                        What SE optimalisation can be done with mod_rewrite? Couldn't think of anything to be honest..
                        ok, let's say you have a url like the following:

                        index.php?id=999&rid=2828&article=123asd

                        that's pretty shitty for Google. I have seen that sometimes
                        google index url's like the one above but google likes
                        static sites (probably with good content => content is god)

                        with mod_rewrite you can rewrite the url via .htaccess to
                        something like this:

                        index/999/2828/123asd.html


                        For this Example, the .htaccess should look like this:


                        Options +FollowSymLinks
                        RewriteEngine on
                        RewriteRule ^index/(.*)/(.*)/(.*).html /index.php?id=$1&rid=$2&article=$3


                        Now you can access the php file with index/999/2828/123asd.html
                        This is also good for using keywords in your url.

                        Comment

                        • Weppel
                          Confirmed User
                          • Aug 2003
                          • 2190

                          #13
                          Originally posted by hornycash


                          ok, let's say you have a url like the following:

                          index.php?id=999&rid=2828&article=123asd

                          that's pretty shitty for Google. I have seen that sometimes
                          google index url's like the one above but google likes
                          static sites (probably with good content => content is god)

                          with mod_rewrite you can rewrite the url via .htaccess to
                          something like this:

                          index/999/2828/123asd.html


                          For this Example, the .htaccess should look like this:


                          Options +FollowSymLinks
                          RewriteEngine on
                          RewriteRule ^index/(.*)/(.*)/(.*).html /index.php?id=$1&rid=$2&article=$3


                          Now you can access the php file with index/999/2828/123asd.html
                          That's some good stuff man..

                          But most of the work done can be done through PHP itself though..

                          What i mostly do is, i parse a html file as a php file. I insert php in the .html file, and there you go. Google thinks its a static page, but it isnt, it's dynamic.

                          Should get you a few positions higher

                          Comment

                          • Weppel
                            Confirmed User
                            • Aug 2003
                            • 2190

                            #14
                            But seriously, i like that stuff. Will keep this thread in mind, and if you have more tutorials / info pages, gimme, and ill start reading through them

                            Comment

                            • hornycash
                              Confirmed User
                              • Jun 2002
                              • 2336

                              #15
                              Originally posted by Weppel
                              But seriously, i like that stuff. Will keep this thread in mind, and if you have more tutorials / info pages, gimme, and ill start reading through them

                              hmm you'll say that you send all your html pages through
                              the parser? god damn, that's a lot of extra work for your
                              machine but....

                              let's say, in your html page is one database query.
                              you wanna select an article from your database
                              now you'll have to send the url like this

                              example.html?article=222

                              with mod_rewrite it would look like

                              example/222.html

                              even more SE friendly

                              Comment

                              • SMG
                                Confirmed User
                                • Aug 2003
                                • 1798

                                #16
                                I hate mod_rewrite

                                for the last 2 days my traffic on one site dropped to under 50% normal ... I couldnt figure out why, everyone could access the site, no problems whatsoever. I also noticed that it was specifically SE traffic that dropped, everything else was fine. I just found out that somehow ensim overwrote my custom modrewrite conf file so all my neat mod_rewrite tricks became 404s
                                TGP Webmasters: sign up for the top 100 tgp list!
                                Submit galleries
                                If you add me to icq (title) make sure to mention GFY or I'll think you're a bot and deny you.

                                Comment

                                • Trafficbrokercom
                                  Confirmed User
                                  • Dec 2002
                                  • 542

                                  #17
                                  Originally posted by hornycash


                                  example.html?article=222

                                  with mod_rewrite it would look like

                                  example/222.html

                                  be careful if you use mod_rewrite to do something like this with a session ID. someone has a patent on this method.

                                  Comment

                                  • hornycash
                                    Confirmed User
                                    • Jun 2002
                                    • 2336

                                    #18
                                    Originally posted by SMG
                                    I hate mod_rewrite

                                    for the last 2 days my traffic on one site dropped to under 50% normal ... I couldnt figure out why, everyone could access the site, no problems whatsoever. I also noticed that it was specifically SE traffic that dropped, everything else was fine. I just found out that somehow ensim overwrote my custom modrewrite conf file so all my neat mod_rewrite tricks became 404s
                                    hmm that sucks. don't you have a backup?

                                    Comment

                                    • init
                                      Confirmed User
                                      • Oct 2002
                                      • 973

                                      #19
                                      Originally posted by hornycash
                                      Heya!

                                      Yes, i got it mod_rewrite was one of the big secrets for me
                                      but now, i figured it out and wanna share my new knowledge
                                      (it's not really deep but enough to set up something) with you
                                      guy's

                                      so come on, let's share something
                                      you should write a little informative tutorial with each command and a basic understanding and how to use it
                                      icq: 2721653

                                      Comment

                                      • Scherfi
                                        Confirmed User
                                        • Jun 2003
                                        • 868

                                        #20
                                        Originally posted by Trafficbrokercom


                                        be careful if you use mod_rewrite to do something like this with a session ID. someone has a patent on this method.
                                        are you serious with this? what exactly is patentent of it?
                                        http://www.fastthumber.com

                                        Comment

                                        Working...