Mod Rewrite Question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • johnbosh
    Confirmed User
    • Aug 2002
    • 8965

    #1

    Mod Rewrite Question

    Hello!
    I have an site where I use links as: http://www.domain.com/gallery.php?id=12

    Now I want to let it mod rewrite that it can also be accessed by:
    http://www.domain.com/gallery/12/

    I heard it could be done with mod rewrite in your .htaccess, I tried many things but I don't get it to work, who can help me?
  • johnbosh
    Confirmed User
    • Aug 2002
    • 8965

    #2
    bump

    Comment

    • goBigtime
      Confirmed User
      • Nov 2002
      • 7761

      #3
      Try this rule:

      RewriteRule /gallery.php?id=([0-9]+) /gallery/$1/

      Comment

      • johnbosh
        Confirmed User
        • Aug 2002
        • 8965

        #4
        Originally posted by goBigtime
        Try this rule:

        RewriteRule /gallery.php?id=([0-9]+) /gallery/$1/
        thx for it, but it does nothin

        Comment

        • M_M
          Confirmed User
          • May 2004
          • 1167

          #5
          did you put:
          RewriteEngine on
          ;-)!;-)!;-)!;-)!;-)!;-)!;-)!;-)!;-)!;-)!;-)

          Comment

          • dgraf
            Confirmed User
            • Jun 2004
            • 133

            #6
            Originally posted by goBigtime
            Try this rule:

            RewriteRule /gallery.php?id=([0-9]+) /gallery/$1/
            IMHO it should be -
            Code:
            RewriteRule /gallery/([0-9]+)/        /gallery.php?id=$1
            Bright Porn | Webmasters | Free Galleries | Sponsors | Traffic Trades | Hardlinks

            Comment

            • Tom_PMs
              Confirmed User
              • Jun 2004
              • 2049

              #7
              Yeah I was just about to post that the original example looks backwards

              Assuming you want people to link to your dynamic page using a simple url as you said, then flip the parts around as dgraf said..

              You've read it, you can't unread it.

              Comment

              • johnbosh
                Confirmed User
                • Aug 2002
                • 8965

                #8
                Originally posted by M_M
                did you put:
                RewriteEngine on
                Jup:D I try again with the post of dgraf:D

                Comment

                Working...