Htaccess Rewrite Help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BIGTYMER
    Junior Achiever
    • Nov 2004
    • 17066

    #1

    Htaccess Rewrite Help

    I'm trying to get a url to rewrite but its not working. I know I'm doing it wrong.

    RewriteEngine on
    RewriteRule ^page?n=(.*)&k=(.*)$ page.php?n=$1&k=$2 [NC]

    I'm trying to get site.com/page?n=VAR&k=VAR to redirect to page.php?n=VAR&k=VAR.

    Thanks for your help.
  • Jack Sparrow
    Almost goners..
    • May 2008
    • 11420

    #2
    Does this help a bit:http://www.askapache.com/htaccess/co...-examples.html

    ?

    Comment

    • LoveSandra
      So Fucking Banned
      • Aug 2008
      • 10551

      #3
      bump bump

      Comment

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

        #4
        thats not very search engine friendly
        Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

        Comment

        • BIGTYMER
          Junior Achiever
          • Nov 2004
          • 17066

          #5
          Originally posted by mrfrisky
          I got it thanks.

          Comment

          • BIGTYMER
            Junior Achiever
            • Nov 2004
            • 17066

            #6
            Originally posted by fris
            thats not very search engine friendly
            Its all good. I'm only using it for click and campaign tracking.

            Comment

            • BIGTYMER
              Junior Achiever
              • Nov 2004
              • 17066

              #7
              Here is the correct working code.

              RewriteEngine on
              RewriteCond %{QUERY_STRING} ^(n=.*)$ [NC,OR]
              RewriteCond %{QUERY_STRING} ^(k=.*)$ [NC]
              RewriteRule ^page(.*)$ /page.php\?&%{QUERY_STRING} [L]

              Comment

              Working...