.htaccess URL Rewrite

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • HomeFry
    Confirmed User
    • Jun 2006
    • 1062

    #1

    .htaccess URL Rewrite

    Can someone post the .htaccess code that will rewrite the following URL:
    http://www.site.com/dir/dir/xxxxx

    TO

    http://www.site.com/dir/dir/index.php?var=xxxxx

    I'm not looking to redirect, I would like the URL to stay as the first example.

    Here's what I have, but for some reason it doesn't work.

    Code:
     Options +FollowSymlinks
     RewriteEngine on
     RewriteRule ^dir/dir/([0-9]+)-([a-z]+) index.php?var=$1 [nc]
    Any help is appreciated.

    Thanks.
    Need Mushrooms Designed? Gimme-Website
  • HomeFry
    Confirmed User
    • Jun 2006
    • 1062

    #2
    Anyone??
    Need Mushrooms Designed? Gimme-Website

    Comment

    • HomeFry
      Confirmed User
      • Jun 2006
      • 1062

      #3
      Anyone at all?
      Need Mushrooms Designed? Gimme-Website

      Comment

      • Brad Gosse
        Confirmed User
        • Jan 2002
        • 2616

        #4
        Redirect /dir/dir/xxxxx/ http://www.site.com/dir/dir/index.php?var=xxxxx
        Free Clipart

        Comment

        • Brad Gosse
          Confirmed User
          • Jan 2002
          • 2616

          #5
          oops nevermind read that u don't want the redirect sorry
          Free Clipart

          Comment

          • Damian_Maxcash
            So Fucking Banned
            • Oct 2002
            • 12745

            #6
            I am not sure I should be giving this little gem away......

            OK, I am in a good mood

            http://www.mod-rewrite-wizard.com/

            EDIT: oh....I read it wrong as well.... I will leave the link though.
            Last edited by Damian_Maxcash; 02-28-2007, 12:56 PM.

            Comment

            • HomeFry
              Confirmed User
              • Jun 2006
              • 1062

              #7
              Originally posted by damian2001
              I am not sure I should be giving this little gem away......

              OK, I am in a good mood

              http://www.mod-rewrite-wizard.com/

              EDIT: oh....I read it wrong as well.... I will leave the link though.
              Actually, I can use this method also. Thanks for the help / link!
              Need Mushrooms Designed? Gimme-Website

              Comment

              • BigBen
                Confirmed User
                • Nov 2004
                • 2299

                #8
                Code:
                RewriteEngine on
                RewriteRule ^([A-Za-z0-9-]+)/?$ index.php?var=$1 [NC,L]
                Put that in /dir/dir/.htaccess

                Comment

                • Briscoe
                  Confirmed User
                  • Mar 2003
                  • 153

                  #9
                  Shame on anyone using .htaccess and mod_rewrite. The ultimate server slow-down.
                  Earn up to 70% per sale and 15% on webmaster referrals
                  Signup for Horny Teen Cum Sluts
                  A CCBill and NoCreditCard partner

                  Comment

                  Working...