.htaccess redirect question

Discussion in 'Apache' started by rldowling03, Aug 1, 2007.

  1. #1
    Hi, I am trying to use .htaccess and rewrite engine to do something. I looked throughout google and come up empty.

    Basically my new site coming out soon, getfromyoutube.com, is a downloader for youtube videos, and as will kissyoutube.com where you can simply just put the word, kiss, infront of the video url to download, i wanna be able to do the same, but users put getfrom infront of the url

    I have hit a snag, i got all code working so it will work, but now i wanna be able to redirect all requests in form of

    /watch?v=something

    to redirect to

    /index.php?v=something

    but everytime i try it wont keep whats after the v=, adn just shows up as v=

    Is this possible and can someone help me on how to do this.

    Thanks
     
    rldowling03, Aug 1, 2007 IP
  2. VimF

    VimF Well-Known Member

    Messages:
    307
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    118
    #2
    Options FollowSymLinks
    RewriteEngine On
    RewriteCond %{QUERY_STRING} v=(.+)
    RewriteRule ^watch$ /index.php?v=%1 [L,NC]
     
    VimF, Aug 1, 2007 IP
  3. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #3
    RewriteCond %{QUERY_STRING} ^v=
    RewriteRule ^watch$ /index.php [QSA,L]
    Code (markup):
    (Oops, had this page open for awhile and didn't notice someone posted :p)
     
    krt, Aug 1, 2007 IP
  4. rldowling03

    rldowling03 Notable Member

    Messages:
    1,763
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    200
    #4
    Thanks guys. always been able to get help at these forums. thanks.
     
    rldowling03, Aug 1, 2007 IP