1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Help me with this mod_rewrite situation?

Discussion in 'Apache' started by Rey, Jul 15, 2005.

  1. #1
    Basically.. I want to make

    "http://www.ffinsider.net/link/?c=1"

    into

    "http://www.ffinsider.net/link/1/"

    But I am not sure what code to put into the .htaccess file. Can anyone help me out? Thanks in advance. :)
     
    Rey, Jul 15, 2005 IP
  2. tflight

    tflight Peon

    Messages:
    617
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    0
    #2
    tflight, Jul 15, 2005 IP
  3. nddb

    nddb Peon

    Messages:
    803
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #3
    i believe, someone correct me if I'm wrong. =)
     
    nddb, Jul 15, 2005 IP
  4. Rey

    Rey Well-Known Member

    Messages:
    232
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    133
    #4
    nddb: I tried your code... it doesn't work.

    tflight: I am not really sure how the link you give me works. It will be appreciated if you can paste down here, thanks :)
     
    Rey, Jul 15, 2005 IP
  5. nddb

    nddb Peon

    Messages:
    803
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Did you do this first? :

    RewriteEngine On


    I rewrite http://www.site.com/node/view/13&id=1234 -> http://www.site.com/node/view/13/1234

    with those lines. So, it's almost the same thing... hrmm!

    Oh, and you can probably get rid of these :

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    Try it without them, since /node/view/13 doesn't exist for me, but /link/ probably exists for you.
     
    nddb, Jul 15, 2005 IP
  6. Rey

    Rey Well-Known Member

    Messages:
    232
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    133
    #6
    RewriteEngine On
    RewriteCond %{QUERY_STRING} ^/link/(.*)$
    RewriteRule ^(.*)$ ^/link/?c=%1 [QSA,L]
    Code (markup):
    Is this the code you want me to put up then?
     
    Rey, Jul 16, 2005 IP
  7. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #7
    Options +Indexes
    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase /
    RewriteRule ^link/(.*)$ index.whatever?c=$1 [L]

    If it's index.php, then

    index.php?c=$1 [L]
     
    Nintendo, Jul 16, 2005 IP
  8. nddb

    nddb Peon

    Messages:
    803
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #8
    yes, that's right. Or nintendos way. Either way, up to you.
     
    nddb, Jul 16, 2005 IP
  9. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #9
    I see a lot of the 'I tried your code... it doesn't work.' so it's always good to have more than one type of code to try!
     
    Nintendo, Jul 16, 2005 IP